array-fill-map

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Fill '' then map
Array(100).fill('').map((e, i) => i + i);
ready
Fill null then map
Array(100).fill(null).map((e, i) => i + i);
ready
Array.from
Array.from({ length: 100 }, (e, i) => i + i)
ready
Array.apply then map
Array.apply(null, Array(100)).map((e, i) => i + i)
ready
Spread then map
[...Array(100)].map((e, i) => i + i)
ready
Spread keys then map
[...Array(100).keys()].map(e => e + e)
ready
Spread repeated string then map
[...'x'.repeat(100)].map((e, i) => i + i)
ready

Revisions

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