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)) 159224.2 Ops/sec
Array.from({length}, () => new Array(length)) 149215.8 Ops/sec
for push 228554.8 Ops/sec
for index 241000.6 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


;