Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Windows
Desktop
2 years ago
.reduce
17/s
for..of (reduce) (destructuring)
17/s
.for (init array)
17/s
for..of (reduce)
16/s
.reduce (destructuring)
16/s
for..of
15/s
for..of (destructuring)
11/s
.map (destructuring)
10/s
.forEach
10/s
.map
9/s
View exact numbers
Test name Executions per second
.reduce 17 Ops/sec
for..of (reduce) (destructuring) 17 Ops/sec
.for (init array) 17 Ops/sec
for..of (reduce) 16 Ops/sec
.reduce (destructuring) 16 Ops/sec
for..of 15 Ops/sec
for..of (destructuring) 11 Ops/sec
.map (destructuring) 10 Ops/sec
.forEach 10 Ops/sec
.map 9 Ops/sec
Script Preparation code:
Tests: