Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0
Chrome 145
Windows
Desktop
5 months ago
for..of (reduce)
38/s
for..of (reduce) (destructuring)
35/s
.reduce
34/s
.reduce (destructuring)
32/s
for..of
32/s
.for (init array)
32/s
.map (destructuring)
26/s
.map
25/s
for..of (destructuring)
25/s
.forEach
18/s
View exact numbers
Test name Executions per second
for..of (reduce) 38 Ops/sec
for..of (reduce) (destructuring) 35 Ops/sec
.reduce 34 Ops/sec
.reduce (destructuring) 32 Ops/sec
for..of 32 Ops/sec
.for (init array) 32 Ops/sec
.map (destructuring) 26 Ops/sec
.map 25 Ops/sec
for..of (destructuring) 25 Ops/sec
.forEach 18 Ops/sec
Script Preparation code:
Tests: