Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Mac OS X 10.15.7
Desktop
2 years ago
for..of (reduce)
17/s
.for (init array)
17/s
for..of (reduce) (destructuring)
17/s
.reduce
16/s
.reduce (destructuring)
16/s
for..of
12/s
.map (destructuring)
11/s
for..of (destructuring)
9/s
.map
8/s
.forEach
8/s
View exact numbers
Test name Executions per second
for..of (reduce) 17 Ops/sec
.for (init array) 17 Ops/sec
for..of (reduce) (destructuring) 17 Ops/sec
.reduce 16 Ops/sec
.reduce (destructuring) 16 Ops/sec
for..of 12 Ops/sec
.map (destructuring) 11 Ops/sec
for..of (destructuring) 9 Ops/sec
.map 8 Ops/sec
.forEach 8 Ops/sec
Script Preparation code:
Tests: