fill then map vs array.from (v3)

Revision 3 of this 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
Second arg map function
Array.from({length: 100}, (_, i) => {
	console.log(i)
})
ready

Revisions

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