Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/142.0
Firefox 142
Linux
Desktop
8 months ago
Test name Executions per second
.forEach 54779.2 Ops/sec
for..of 52724.8 Ops/sec
for..of (destructuring) 45006.3 Ops/sec
.map 58509.6 Ops/sec
.map (destructuring) 56708.9 Ops/sec
.for (init array) 57086.6 Ops/sec
.reduce 47270.9 Ops/sec
.reduce (destructuring) 37423.3 Ops/sec
for..of (reduce) 40490.9 Ops/sec
for..of (reduce) (destructuring) 57006.4 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)