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
one year ago
.for (init array)
37/s
.reduce (destructuring)
33/s
for..of
33/s
for..of (reduce) (destructuring)
33/s
.reduce
33/s
for..of (reduce)
33/s
.forEach
27/s
for..of (destructuring)
23/s
.map
20/s
.map (destructuring)
20/s
View exact numbers
Test name Executions per second
.for (init array) 37 Ops/sec
.reduce (destructuring) 33 Ops/sec
for..of 33 Ops/sec
for..of (reduce) (destructuring) 33 Ops/sec
.reduce 33 Ops/sec
for..of (reduce) 33 Ops/sec
.forEach 27 Ops/sec
for..of (destructuring) 23 Ops/sec
.map 20 Ops/sec
.map (destructuring) 20 Ops/sec
Script Preparation code:
Tests: