Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Windows
Desktop
7 months ago
Test name Executions per second
Array.from(new Array(length), () => new Array(length)) 160453.8 Ops/sec
Array.from({length}, () => new Array(length)) 150472.2 Ops/sec
for push 227218.6 Ops/sec
for index 239894.0 Ops/sec
Array.from(Array(length), () => new Array(length)) 161594.3 Ops/sec
for push set size 221498.6 Ops/sec
for index set size 233617.0 Ops/sec
Tests:
  • Array.from(new Array(length), () => new Array(length))

  • Array.from({length}, () => new Array(length))

  • for push

  • for index

  • Array.from(Array(length), () => new Array(length))

  • for push set size

  • for index set size


;