Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.24
Chrome 107
Linux
Desktop
one year ago
.forEach
39/s
.reduce
37/s
.reduce (destructuring)
37/s
for..of (reduce) (destructuring)
36/s
for..of (reduce)
36/s
for..of
36/s
.for (init array)
34/s
.map
34/s
.map (destructuring)
32/s
for..of (destructuring)
31/s
View exact numbers
Test name Executions per second
.forEach 39 Ops/sec
.reduce 37 Ops/sec
.reduce (destructuring) 37 Ops/sec
for..of (reduce) (destructuring) 36 Ops/sec
for..of (reduce) 36 Ops/sec
for..of 36 Ops/sec
.for (init array) 34 Ops/sec
.map 34 Ops/sec
.map (destructuring) 32 Ops/sec
for..of (destructuring) 31 Ops/sec
Script Preparation code:
Tests: