Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0
Chrome 128
Windows
Desktop
one year ago
for..of (reduce) (destructuring)
33/s
for..of (reduce)
30/s
.reduce
30/s
for..of
30/s
.reduce (destructuring)
29/s
for..of (destructuring)
25/s
.map
22/s
.map (destructuring)
21/s
.forEach
6/s
.for (init array)
5/s
View exact numbers
Test name Executions per second
for..of (reduce) (destructuring) 33 Ops/sec
for..of (reduce) 30 Ops/sec
.reduce 30 Ops/sec
for..of 30 Ops/sec
.reduce (destructuring) 29 Ops/sec
for..of (destructuring) 25 Ops/sec
.map 22 Ops/sec
.map (destructuring) 21 Ops/sec
.forEach 6 Ops/sec
.for (init array) 5 Ops/sec
Script Preparation code:
Tests: