Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134
Windows
Desktop
one year ago
for..of (reduce) (destructuring)
43/s
for..of
36/s
for..of (reduce)
31/s
.for (init array)
30/s
.map (destructuring)
29/s
.reduce
27/s
.reduce (destructuring)
26/s
for..of (destructuring)
24/s
.map
23/s
.forEach
19/s
View exact numbers
Test name Executions per second
for..of (reduce) (destructuring) 43 Ops/sec
for..of 36 Ops/sec
for..of (reduce) 31 Ops/sec
.for (init array) 30 Ops/sec
.map (destructuring) 29 Ops/sec
.reduce 27 Ops/sec
.reduce (destructuring) 26 Ops/sec
for..of (destructuring) 24 Ops/sec
.map 23 Ops/sec
.forEach 19 Ops/sec
Script Preparation code:
Tests: