Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Windows
Desktop
one year ago
for..of (reduce)
27/s
for..of
25/s
.for (init array)
24/s
for..of (reduce) (destructuring)
24/s
for..of (destructuring)
19/s
.map
16/s
.map (destructuring)
15/s
.forEach
15/s
.reduce (destructuring)
14/s
.reduce
11/s
View exact numbers
Test name Executions per second
for..of (reduce) 27 Ops/sec
for..of 25 Ops/sec
.for (init array) 24 Ops/sec
for..of (reduce) (destructuring) 24 Ops/sec
for..of (destructuring) 19 Ops/sec
.map 16 Ops/sec
.map (destructuring) 15 Ops/sec
.forEach 15 Ops/sec
.reduce (destructuring) 14 Ops/sec
.reduce 11 Ops/sec
Script Preparation code:
Tests: