Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Chrome 128
Linux
Desktop
3 months ago
Test name Executions per second
.forEach 31.4 Ops/sec
for..of 31.9 Ops/sec
for..of (destructuring) 19.4 Ops/sec
.map 21.9 Ops/sec
.map (destructuring) 25.6 Ops/sec
.for (init array) 34.4 Ops/sec
.reduce 42.6 Ops/sec
.reduce (destructuring) 38.1 Ops/sec
for..of (reduce) 32.5 Ops/sec
for..of (reduce) (destructuring) 41.8 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)