Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 15_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Mobile/15E148 Safari/604.1
Mobile Safari 15
iOS 15.6.1
Mobile
11 months ago
Test name Executions per second
.forEach 28.6 Ops/sec
for..of 28.5 Ops/sec
for..of (destructuring) 27.7 Ops/sec
.map 32.4 Ops/sec
.map (destructuring) 24.0 Ops/sec
.for (init array) 26.2 Ops/sec
.reduce 25.3 Ops/sec
.reduce (destructuring) 22.1 Ops/sec
for..of (reduce) 25.5 Ops/sec
for..of (reduce) (destructuring) 25.0 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)