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