Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0
Firefox 149
Windows
Desktop
26 days ago
Test name Executions per second
.forEach 104525.8 Ops/sec
for..of 103553.4 Ops/sec
for..of (destructuring) 83160.4 Ops/sec
.map 81226.0 Ops/sec
.map (destructuring) 85990.1 Ops/sec
.for (init array) 103495.0 Ops/sec
.reduce 99565.0 Ops/sec
.reduce (destructuring) 88471.0 Ops/sec
for..of (reduce) 96089.3 Ops/sec
for..of (reduce) (destructuring) 83354.0 Ops/sec
Script Preparation code:
Tests:
  • .forEach

  • for..of

  • for..of (destructuring)

  • .map

  • .map (destructuring)

  • .for (init array)

  • .reduce

  • .reduce (destructuring)

  • for..of (reduce)

  • for..of (reduce) (destructuring)