Run details:
Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Windows 8.1
Desktop
one year ago
Test name Executions per second
.forEach 23.6 Ops/sec
for..of 22.2 Ops/sec
for..of (destructuring) 19.1 Ops/sec
.map 17.7 Ops/sec
.map (destructuring) 17.1 Ops/sec
.for (init array) 21.6 Ops/sec
.reduce 23.6 Ops/sec
.reduce (destructuring) 23.3 Ops/sec
for..of (reduce) 24.2 Ops/sec
for..of (reduce) (destructuring) 20.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)