Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:134.0) Gecko/20100101 Firefox/134.0
Firefox 134
Mac OS X 10.15
Desktop
one year ago
for..of
87/s
for..of (reduce)
86/s
.forEach
86/s
.for (init array)
85/s
for..of (reduce) (destructuring)
84/s
.map
78/s
.map (destructuring)
78/s
for..of (destructuring)
76/s
.reduce (destructuring)
72/s
.reduce
71/s
View exact numbers
Test name Executions per second
for..of 87 Ops/sec
for..of (reduce) 86 Ops/sec
.forEach 86 Ops/sec
.for (init array) 85 Ops/sec
for..of (reduce) (destructuring) 84 Ops/sec
.map 78 Ops/sec
.map (destructuring) 78 Ops/sec
for..of (destructuring) 76 Ops/sec
.reduce (destructuring) 72 Ops/sec
.reduce 71 Ops/sec
Script Preparation code:
Tests: