Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 120
iOS 17.3
Mobile
11 months ago
Test name Executions per second
.forEach 56.9 Ops/sec
for..of 60.0 Ops/sec
for..of (destructuring) 57.0 Ops/sec
.map 60.8 Ops/sec
.map (destructuring) 60.2 Ops/sec
.for (init array) 55.9 Ops/sec
.reduce 53.1 Ops/sec
.reduce (destructuring) 51.5 Ops/sec
for..of (reduce) 51.3 Ops/sec
for..of (reduce) (destructuring) 52.6 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)