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)
54/s
.reduce
49/s
.reduce (destructuring)
48/s
for..of
46/s
for..of (reduce) (destructuring)
45/s
for..of (reduce)
44/s
.map (destructuring)
37/s
for..of (destructuring)
36/s
.map
36/s
.forEach
28/s
View exact numbers
Test name Executions per second
.for (init array) 54 Ops/sec
.reduce 49 Ops/sec
.reduce (destructuring) 48 Ops/sec
for..of 46 Ops/sec
for..of (reduce) (destructuring) 45 Ops/sec
for..of (reduce) 44 Ops/sec
.map (destructuring) 37 Ops/sec
for..of (destructuring) 36 Ops/sec
.map 36 Ops/sec
.forEach 28 Ops/sec
Script Preparation code:
Tests: