array fill

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
fill 10
const n = 10;

const arr = Array(n).fill(null).map(() => Math.random())
ready
fill 100
const n = 100;

const arr = Array(n).fill(null).map(() => Math.random())
ready
fill 1000
const n = 1000;

const arr = Array(n).fill(null).map(() => Math.random())
ready
fill 10000
const n = 10000;

const arr = Array(n).fill(null).map(() => Math.random())
ready
from 10
const n = 10;

const arr = Array.from({ length: n }, () => Math.random())
ready
from 100
const n = 100;

const arr = Array.from({ length: n }, () => Math.random())
ready
from 1000
const n = 1000;

const arr = Array.from({ length: n }, () => Math.random())
ready
from 10000
const n = 10000;

const arr = Array.from({ length: n }, () => Math.random())
ready

Revisions

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