Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134
Mac OS X 10.15.7
Desktop
one year ago
.for (init array)
111/s
.reduce (destructuring)
79/s
.reduce
79/s
for..of (reduce)
76/s
for..of
72/s
.map
67/s
.map (destructuring)
66/s
for..of (destructuring)
61/s
.forEach
54/s
for..of (reduce) (destructuring)
46/s
View exact numbers
Test name Executions per second
.for (init array) 111 Ops/sec
.reduce (destructuring) 79 Ops/sec
.reduce 79 Ops/sec
for..of (reduce) 76 Ops/sec
for..of 72 Ops/sec
.map 67 Ops/sec
.map (destructuring) 66 Ops/sec
for..of (destructuring) 61 Ops/sec
.forEach 54 Ops/sec
for..of (reduce) (destructuring) 46 Ops/sec
Script Preparation code:
Tests: