Array.from VS new Array

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
new Array
new Array(10000000)
	.fill(null)
    .map((_, i) => i+1);
ready
Array.from
Array.from({ length: 10000000 }, (_, i) => i+1);
ready
Array.from with map
Array.from({ length: 10000000 }).map((_, i) => i+1);;
ready

Revisions

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