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