Array from vs fill

Benchmark created on


Setup

let n = 10000;

const from = length => Array.from({length});

const fill= length => Array(length).fill(0);

Test runner

Ready to run.

Testing in
TestOps/sec
array.from
from(n)
ready
array.fill
fill(n)
ready

Revisions

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