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)
23/s
.reduce
18/s
.reduce (destructuring)
18/s
.map (destructuring)
18/s
.map
17/s
for..of (reduce)
16/s
for..of (reduce) (destructuring)
16/s
for..of (destructuring)
16/s
for..of
16/s
.forEach
13/s
View exact numbers
Test name Executions per second
.for (init array) 23 Ops/sec
.reduce 18 Ops/sec
.reduce (destructuring) 18 Ops/sec
.map (destructuring) 18 Ops/sec
.map 17 Ops/sec
for..of (reduce) 16 Ops/sec
for..of (reduce) (destructuring) 16 Ops/sec
for..of (destructuring) 16 Ops/sec
for..of 16 Ops/sec
.forEach 13 Ops/sec
Script Preparation code:
Tests: