Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Chrome 147
Mac OS X 10.15.7
Desktop
3 months ago
for..of (reduce) (destructuring)
86/s
for..of
84/s
for..of (reduce)
83/s
.for (init array)
82/s
for..of (destructuring)
63/s
.reduce
57/s
.reduce (destructuring)
56/s
.map (destructuring)
46/s
.map
44/s
.forEach
20/s
View exact numbers
Test name Executions per second
for..of (reduce) (destructuring) 86 Ops/sec
for..of 84 Ops/sec
for..of (reduce) 83 Ops/sec
.for (init array) 82 Ops/sec
for..of (destructuring) 63 Ops/sec
.reduce 57 Ops/sec
.reduce (destructuring) 56 Ops/sec
.map (destructuring) 46 Ops/sec
.map 44 Ops/sec
.forEach 20 Ops/sec
Script Preparation code:
Tests: