Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0
Chrome 134
Linux
Desktop
one year ago
.for (init array)
47/s
for..of
44/s
for..of (reduce)
43/s
for..of (reduce) (destructuring)
43/s
.reduce
38/s
.reduce (destructuring)
35/s
for..of (destructuring)
28/s
.map (destructuring)
28/s
.map
26/s
.forEach
14/s
View exact numbers
Test name Executions per second
.for (init array) 47 Ops/sec
for..of 44 Ops/sec
for..of (reduce) 43 Ops/sec
for..of (reduce) (destructuring) 43 Ops/sec
.reduce 38 Ops/sec
.reduce (destructuring) 35 Ops/sec
for..of (destructuring) 28 Ops/sec
.map (destructuring) 28 Ops/sec
.map 26 Ops/sec
.forEach 14 Ops/sec
Script Preparation code:
Tests: