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
for..of (reduce) (destructuring)
14/s
for..of (reduce)
11/s
for..of
10/s
.reduce (destructuring)
9/s
.for (init array)
8/s
.forEach
7/s
for..of (destructuring)
6/s
.map (destructuring)
6/s
.map
5/s
.reduce
4/s
View exact numbers
Test name Executions per second
for..of (reduce) (destructuring) 14 Ops/sec
for..of (reduce) 11 Ops/sec
for..of 10 Ops/sec
.reduce (destructuring) 9 Ops/sec
.for (init array) 8 Ops/sec
.forEach 7 Ops/sec
for..of (destructuring) 6 Ops/sec
.map (destructuring) 6 Ops/sec
.map 5 Ops/sec
.reduce 4 Ops/sec
Script Preparation code:
Tests: