Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/142.0
Firefox 142
Linux
Desktop
one year ago
Benchmark.js
.map
59K/s
.for (init array)
57K/s
for..of (reduce) (destructuring)
57K/s
.map (destructuring)
57K/s
.forEach
55K/s
for..of
53K/s
.reduce
47K/s
for..of (destructuring)
45K/s
for..of (reduce)
40K/s
.reduce (destructuring)
37K/s
View exact numbers
Test name Executions per second
.map 58,510 Ops/sec
.for (init array) 57,087 Ops/sec
for..of (reduce) (destructuring) 57,006 Ops/sec
.map (destructuring) 56,709 Ops/sec
.forEach 54,779 Ops/sec
for..of 52,725 Ops/sec
.reduce 47,271 Ops/sec
for..of (destructuring) 45,006 Ops/sec
for..of (reduce) 40,491 Ops/sec
.reduce (destructuring) 37,423 Ops/sec
Script Preparation code:
Tests: