Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Firefox 120
Windows
Desktop
2 years ago
.reduce (destructuring)
13/s
for..of (reduce)
13/s
.forEach
12/s
for..of
11/s
.for (init array)
11/s
for..of (reduce) (destructuring)
11/s
.reduce
10/s
for..of (destructuring)
10/s
.map
10/s
.map (destructuring)
8/s
View exact numbers
Test name Executions per second
.reduce (destructuring) 13 Ops/sec
for..of (reduce) 13 Ops/sec
.forEach 12 Ops/sec
for..of 11 Ops/sec
.for (init array) 11 Ops/sec
for..of (reduce) (destructuring) 11 Ops/sec
.reduce 10 Ops/sec
for..of (destructuring) 10 Ops/sec
.map 10 Ops/sec
.map (destructuring) 8 Ops/sec
Script Preparation code:
Tests: