Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Chrome 137
Mac OS X 10.15.7
Desktop
one year ago
.for (init array)
95/s
for..of
74/s
.reduce (destructuring)
73/s
.reduce
73/s
for..of (reduce) (destructuring)
72/s
for..of (reduce)
70/s
.map
59/s
.map (destructuring)
59/s
for..of (destructuring)
54/s
.forEach
49/s
View exact numbers
Test name Executions per second
.for (init array) 95 Ops/sec
for..of 74 Ops/sec
.reduce (destructuring) 73 Ops/sec
.reduce 73 Ops/sec
for..of (reduce) (destructuring) 72 Ops/sec
for..of (reduce) 70 Ops/sec
.map 59 Ops/sec
.map (destructuring) 59 Ops/sec
for..of (destructuring) 54 Ops/sec
.forEach 49 Ops/sec
Script Preparation code:
Tests: