Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Chrome 125
Linux
Desktop
2 years ago
.for (init array)
41/s
for..of (reduce)
34/s
for..of (reduce) (destructuring)
30/s
.reduce
30/s
.reduce (destructuring)
29/s
.map (destructuring)
18/s
.map
18/s
.forEach
15/s
for..of
12/s
for..of (destructuring)
8/s
View exact numbers
Test name Executions per second
.for (init array) 41 Ops/sec
for..of (reduce) 34 Ops/sec
for..of (reduce) (destructuring) 30 Ops/sec
.reduce 30 Ops/sec
.reduce (destructuring) 29 Ops/sec
.map (destructuring) 18 Ops/sec
.map 18 Ops/sec
.forEach 15 Ops/sec
for..of 12 Ops/sec
for..of (destructuring) 8 Ops/sec
Script Preparation code:
Tests: