Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Mac OS X 10.15.7
Desktop
one year ago
.for (init array)
64/s
.reduce (destructuring)
47/s
.reduce
46/s
for..of (reduce)
45/s
for..of (reduce) (destructuring)
45/s
for..of
44/s
.map
36/s
.map (destructuring)
36/s
for..of (destructuring)
35/s
.forEach
30/s
View exact numbers
Test name Executions per second
.for (init array) 64 Ops/sec
.reduce (destructuring) 47 Ops/sec
.reduce 46 Ops/sec
for..of (reduce) 45 Ops/sec
for..of (reduce) (destructuring) 45 Ops/sec
for..of 44 Ops/sec
.map 36 Ops/sec
.map (destructuring) 36 Ops/sec
for..of (destructuring) 35 Ops/sec
.forEach 30 Ops/sec
Script Preparation code:
Tests: