Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/118.0.5993.92 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 118
iOS 17.0
Mobile
one year ago
Test name Executions per second
.forEach 31.6 Ops/sec
for..of 30.3 Ops/sec
for..of (destructuring) 21.4 Ops/sec
.map 29.5 Ops/sec
.map (destructuring) 31.6 Ops/sec
.for (init array) 34.9 Ops/sec
.reduce 34.9 Ops/sec
.reduce (destructuring) 29.4 Ops/sec
for..of (reduce) 25.5 Ops/sec
for..of (reduce) (destructuring) 29.2 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)