Run details:
Mozilla/5.0 (Android 12; Mobile; rv:105.0) Gecko/105.0 Firefox/105.0
Firefox Mobile 105
Android
Mobile
2 years ago
Test name Executions per second
.forEach 10.7 Ops/sec
for..of 12.5 Ops/sec
for..of (destructuring) 9.9 Ops/sec
.map 12.1 Ops/sec
.map (destructuring) 11.4 Ops/sec
.for (init array) 11.5 Ops/sec
.reduce 11.0 Ops/sec
.reduce (destructuring) 12.2 Ops/sec
for..of (reduce) 14.3 Ops/sec
for..of (reduce) (destructuring) 10.7 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)