Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Chrome 132
Mac OS X 10.15.7
Desktop
one year ago
.for (init array)
66/s
for..of (reduce)
52/s
for..of
52/s
.reduce
50/s
.reduce (destructuring)
49/s
for..of (reduce) (destructuring)
46/s
.map
41/s
.map (destructuring)
38/s
for..of (destructuring)
36/s
.forEach
29/s
View exact numbers
Test name Executions per second
.for (init array) 66 Ops/sec
for..of (reduce) 52 Ops/sec
for..of 52 Ops/sec
.reduce 50 Ops/sec
.reduce (destructuring) 49 Ops/sec
for..of (reduce) (destructuring) 46 Ops/sec
.map 41 Ops/sec
.map (destructuring) 38 Ops/sec
for..of (destructuring) 36 Ops/sec
.forEach 29 Ops/sec
Script Preparation code:
Tests: