Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [LinkedInApp]/9.29.1938
Mobile Safari 17
iOS 17.2.1
Mobile
10 months ago
Test name Executions per second
.forEach 29.5 Ops/sec
for..of 41.8 Ops/sec
for..of (destructuring) 34.5 Ops/sec
.map 36.2 Ops/sec
.map (destructuring) 23.5 Ops/sec
.for (init array) 32.1 Ops/sec
.reduce 32.3 Ops/sec
.reduce (destructuring) 41.9 Ops/sec
for..of (reduce) 33.3 Ops/sec
for..of (reduce) (destructuring) 31.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)