fill then map vs array.from

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Fill then map
new Array(100).fill('').map((_, i) => {
	console.log(i)
})
ready
array.from
Array.from({length: 100}).map((_, i) => {
	console.log(i)
})
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.