Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/122.0.6261.89 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 122
iOS 17.3
Mobile
9 months ago
Test name Executions per second
.forEach 76.7 Ops/sec
for..of 71.3 Ops/sec
for..of (destructuring) 58.1 Ops/sec
.map 64.5 Ops/sec
.map (destructuring) 60.6 Ops/sec
.for (init array) 60.2 Ops/sec
.reduce 59.3 Ops/sec
.reduce (destructuring) 61.8 Ops/sec
for..of (reduce) 62.1 Ops/sec
for..of (reduce) (destructuring) 57.9 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)