Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Chrome 137
Linux
Desktop
one year ago
.for (init array)
31/s
for..of (reduce)
28/s
.reduce
28/s
for..of
27/s
for..of (reduce) (destructuring)
27/s
.reduce (destructuring)
26/s
.map
23/s
.map (destructuring)
23/s
for..of (destructuring)
20/s
.forEach
11/s
View exact numbers
Test name Executions per second
.for (init array) 31 Ops/sec
for..of (reduce) 28 Ops/sec
.reduce 28 Ops/sec
for..of 27 Ops/sec
for..of (reduce) (destructuring) 27 Ops/sec
.reduce (destructuring) 26 Ops/sec
.map 23 Ops/sec
.map (destructuring) 23 Ops/sec
for..of (destructuring) 20 Ops/sec
.forEach 11 Ops/sec
Script Preparation code:
Tests: