Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0
Chrome 124
Windows
Desktop
2 years ago
for..of (reduce)
30/s
.for (init array)
28/s
.reduce
27/s
for..of (reduce) (destructuring)
26/s
.reduce (destructuring)
26/s
for..of
25/s
.map (destructuring)
16/s
for..of (destructuring)
16/s
.forEach
15/s
.map
15/s
View exact numbers
Test name Executions per second
for..of (reduce) 30 Ops/sec
.for (init array) 28 Ops/sec
.reduce 27 Ops/sec
for..of (reduce) (destructuring) 26 Ops/sec
.reduce (destructuring) 26 Ops/sec
for..of 25 Ops/sec
.map (destructuring) 16 Ops/sec
for..of (destructuring) 16 Ops/sec
.forEach 15 Ops/sec
.map 15 Ops/sec
Script Preparation code:
Tests: