Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0
Firefox 107
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
.forEach 54.6 Ops/sec
for..of 54.9 Ops/sec
for..of (destructuring) 44.6 Ops/sec
.map 47.5 Ops/sec
.map (destructuring) 47.6 Ops/sec
.for (init array) 60.1 Ops/sec
.reduce 49.9 Ops/sec
.reduce (destructuring) 49.8 Ops/sec
for..of (reduce) 56.2 Ops/sec
for..of (reduce) (destructuring) 55.4 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)


;