Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Chrome 141
Mac OS X 10.15.7
Desktop
11 months ago
Benchmark.js
for..of
251K/s
.forEach
249K/s
for..of (reduce)
248K/s
for..of (reduce) (destructuring)
247K/s
.for (init array)
213K/s
.reduce (destructuring)
210K/s
.reduce
210K/s
.map
183K/s
.map (destructuring)
182K/s
for..of (destructuring)
169K/s
View exact numbers
Test name Executions per second
for..of 250,690 Ops/sec
.forEach 248,817 Ops/sec
for..of (reduce) 247,902 Ops/sec
for..of (reduce) (destructuring) 246,613 Ops/sec
.for (init array) 212,714 Ops/sec
.reduce (destructuring) 210,183 Ops/sec
.reduce 209,722 Ops/sec
.map 183,429 Ops/sec
.map (destructuring) 181,661 Ops/sec
for..of (destructuring) 169,335 Ops/sec
Script Preparation code:
Tests: