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)) 154245.3 Ops/sec
Array.from({length}, () => new Array(length)) 152616.1 Ops/sec
for push 226480.8 Ops/sec
for index 239932.4 Ops/sec
Array.from(Array(length), () => new Array(length)) 151653.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


;