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
51/s
.forEach
50/s
.for (init array)
48/s
.map (destructuring)
45/s
.map
45/s
for..of (destructuring)
45/s
for..of (reduce)
23/s
for..of (reduce) (destructuring)
22/s
.reduce
21/s
.reduce (destructuring)
21/s
View exact numbers
Test name Executions per second
for..of 51 Ops/sec
.forEach 50 Ops/sec
.for (init array) 48 Ops/sec
.map (destructuring) 45 Ops/sec
.map 45 Ops/sec
for..of (destructuring) 45 Ops/sec
for..of (reduce) 23 Ops/sec
for..of (reduce) (destructuring) 22 Ops/sec
.reduce 21 Ops/sec
.reduce (destructuring) 21 Ops/sec
Script Preparation code:
Tests: