Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0
Firefox 130
Mac OS X 10.15
Desktop
one year ago
.forEach
58/s
.for (init array)
57/s
for..of (reduce)
56/s
for..of
54/s
for..of (reduce) (destructuring)
51/s
.map
51/s
.map (destructuring)
50/s
for..of (destructuring)
50/s
.reduce
50/s
.reduce (destructuring)
49/s
View exact numbers
Test name Executions per second
.forEach 58 Ops/sec
.for (init array) 57 Ops/sec
for..of (reduce) 56 Ops/sec
for..of 54 Ops/sec
for..of (reduce) (destructuring) 51 Ops/sec
.map 51 Ops/sec
.map (destructuring) 50 Ops/sec
for..of (destructuring) 50 Ops/sec
.reduce 50 Ops/sec
.reduce (destructuring) 49 Ops/sec
Script Preparation code:
Tests: