Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0
Chrome 130
Windows
Desktop
one year ago
.for (init array)
17/s
.reduce
17/s
for..of (reduce) (destructuring)
16/s
.reduce (destructuring)
15/s
for..of (reduce)
14/s
for..of
13/s
.map (destructuring)
10/s
for..of (destructuring)
10/s
.map
9/s
.forEach
9/s
View exact numbers
Test name Executions per second
.for (init array) 17 Ops/sec
.reduce 17 Ops/sec
for..of (reduce) (destructuring) 16 Ops/sec
.reduce (destructuring) 15 Ops/sec
for..of (reduce) 14 Ops/sec
for..of 13 Ops/sec
.map (destructuring) 10 Ops/sec
for..of (destructuring) 10 Ops/sec
.map 9 Ops/sec
.forEach 9 Ops/sec
Script Preparation code:
Tests: