Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Chrome 136
Mac OS X 10.15.7
Desktop
one year ago
.for (init array)
90/s
.reduce
69/s
for..of (reduce)
66/s
for..of (reduce) (destructuring)
66/s
.reduce (destructuring)
65/s
for..of
65/s
for..of (destructuring)
53/s
.map
51/s
.map (destructuring)
50/s
.forEach
49/s
View exact numbers
Test name Executions per second
.for (init array) 90 Ops/sec
.reduce 69 Ops/sec
for..of (reduce) 66 Ops/sec
for..of (reduce) (destructuring) 66 Ops/sec
.reduce (destructuring) 65 Ops/sec
for..of 65 Ops/sec
for..of (destructuring) 53 Ops/sec
.map 51 Ops/sec
.map (destructuring) 50 Ops/sec
.forEach 49 Ops/sec
Script Preparation code:
Tests: