Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Windows
Desktop
2 years ago
for..of
26/s
.for (init array)
24/s
.reduce (destructuring)
23/s
for..of (reduce) (destructuring)
22/s
for..of (reduce)
20/s
.reduce
20/s
.forEach
17/s
for..of (destructuring)
16/s
.map (destructuring)
15/s
.map
13/s
View exact numbers
Test name Executions per second
for..of 26 Ops/sec
.for (init array) 24 Ops/sec
.reduce (destructuring) 23 Ops/sec
for..of (reduce) (destructuring) 22 Ops/sec
for..of (reduce) 20 Ops/sec
.reduce 20 Ops/sec
.forEach 17 Ops/sec
for..of (destructuring) 16 Ops/sec
.map (destructuring) 15 Ops/sec
.map 13 Ops/sec
Script Preparation code:
Tests: