fill then map vs array.from (v4)

Revision 4 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Fill then map
new Array(100).fill('').map((_, i) => {
	return i + i;
})
ready
array.from
Array.from({length: 100}).map((_, i) => {
	return i + i;
})
ready
Second arg map function
Array.from({length: 100}, (_, i) => {
	return i + i;
})
ready

Revisions

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