Test name | Executions per second |
---|---|
Set-length array | 836.4 Ops/sec |
Array.push | 1.1 Ops/sec |
let arr = Array(1000).fill(undefined).map(e => Math.floor(Math.random()*1000000+1));
let arr = [];
for (i=0; i<1000001; i++){arr.push(Math.floor(Math.random()*1000000+1))}