Fill an array

Benchmark created on


Setup

const fillValue = 123456789;
const initialArray = new Array(10_000).fill(0);

Test runner

Ready to run.

Testing in
TestOps/sec
Map
const result = initialArray.map(v => fillValue);
ready
Fill
const result = new Array(initialArray.length).fill(fillValue);
ready

Revisions

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