Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Firefox 148
Windows
Desktop
5 months ago
.forEach
53/s
for..of
52/s
for..of (destructuring)
33/s
for..of (reduce)
26/s
.reduce (destructuring)
25/s
.reduce
25/s
for..of (reduce) (destructuring)
24/s
.for (init array)
23/s
.map (destructuring)
23/s
.map
23/s
View exact numbers
Test name Executions per second
.forEach 53 Ops/sec
for..of 52 Ops/sec
for..of (destructuring) 33 Ops/sec
for..of (reduce) 26 Ops/sec
.reduce (destructuring) 25 Ops/sec
.reduce 25 Ops/sec
for..of (reduce) (destructuring) 24 Ops/sec
.for (init array) 23 Ops/sec
.map (destructuring) 23 Ops/sec
.map 23 Ops/sec
Script Preparation code:
Tests: