Script Preparation code:
Tests:

Historical Performance Data aggregated from 474 community runs

Desktop Results:
Chrome 355 runs
.for (init array)
34/s
.reduce
31/s
.reduce (destructuring)
31/s
for..of (reduce)
30/s
for..of (reduce) (destructuring)
30/s
for..of
30/s
.forEach
22/s
.map
21/s
.map (destructuring)
21/s
for..of (destructuring)
21/s

Fastest: .for (init array) (1.6x faster)

View exact numbers
  • .for (init array): 34 ops/sec
  • .reduce: 31 ops/sec
  • .reduce (destructuring): 31 ops/sec
  • for..of (reduce): 30 ops/sec
  • for..of (reduce) (destructuring): 30 ops/sec
  • for..of: 30 ops/sec
  • .forEach: 22 ops/sec
  • .map: 21 ops/sec
  • .map (destructuring): 21 ops/sec
  • for..of (destructuring): 21 ops/sec
Firefox 67 runs
.forEach
38/s
.reduce (destructuring)
37/s
for..of
37/s
.reduce
37/s
for..of (reduce)
36/s
.for (init array)
35/s
for..of (reduce) (destructuring)
34/s
.map
32/s
.map (destructuring)
32/s
for..of (destructuring)
32/s

Fastest: .forEach (1.2x faster)

View exact numbers
  • .forEach: 38 ops/sec
  • .reduce (destructuring): 37 ops/sec
  • for..of: 37 ops/sec
  • .reduce: 37 ops/sec
  • for..of (reduce): 36 ops/sec
  • .for (init array): 35 ops/sec
  • for..of (reduce) (destructuring): 34 ops/sec
  • .map: 32 ops/sec
  • .map (destructuring): 32 ops/sec
  • for..of (destructuring): 32 ops/sec
Safari 13 runs
for..of
110/s
.forEach
108/s
.reduce (destructuring)
104/s
for..of (reduce)
103/s
.reduce
103/s
for..of (reduce) (destructuring)
102/s
.for (init array)
102/s
.map
98/s
.map (destructuring)
96/s
for..of (destructuring)
92/s

Fastest: for..of (1.2x faster)

View exact numbers
  • for..of: 110 ops/sec
  • .forEach: 108 ops/sec
  • .reduce (destructuring): 104 ops/sec
  • for..of (reduce): 103 ops/sec
  • .reduce: 103 ops/sec
  • for..of (reduce) (destructuring): 102 ops/sec
  • .for (init array): 102 ops/sec
  • .map: 98 ops/sec
  • .map (destructuring): 96 ops/sec
  • for..of (destructuring): 92 ops/sec
Other 6 runs
for..of (reduce)
30/s
.reduce
29/s
.reduce (destructuring)
29/s
for..of
28/s
.for (init array)
27/s
for..of (reduce) (destructuring)
22/s
for..of (destructuring)
18/s
.map (destructuring)
17/s
.map
16/s
.forEach
11/s

Fastest: for..of (reduce) (2.8x faster)

View exact numbers
  • for..of (reduce): 30 ops/sec
  • .reduce: 29 ops/sec
  • .reduce (destructuring): 29 ops/sec
  • for..of: 28 ops/sec
  • .for (init array): 27 ops/sec
  • for..of (reduce) (destructuring): 22 ops/sec
  • for..of (destructuring): 18 ops/sec
  • .map (destructuring): 17 ops/sec
  • .map: 16 ops/sec
  • .forEach: 11 ops/sec
Mobile Results:
Chrome 24 runs
for..of (reduce) (destructuring)
14/s
for..of (reduce)
14/s
.for (init array)
13/s
for..of
13/s
.reduce
12/s
.reduce (destructuring)
12/s
.forEach
8/s
for..of (destructuring)
8/s
.map
6/s
.map (destructuring)
6/s

Fastest: for..of (reduce) (destructuring) (2.3x faster)

View exact numbers
  • for..of (reduce) (destructuring): 14 ops/sec
  • for..of (reduce): 14 ops/sec
  • .for (init array): 13 ops/sec
  • for..of: 13 ops/sec
  • .reduce: 12 ops/sec
  • .reduce (destructuring): 12 ops/sec
  • .forEach: 8 ops/sec
  • for..of (destructuring): 8 ops/sec
  • .map: 6 ops/sec
  • .map (destructuring): 6 ops/sec
Safari 9 runs
for..of
42/s
.reduce (destructuring)
36/s
.map
36/s
for..of (destructuring)
34/s
for..of (reduce)
33/s
.reduce
32/s
.for (init array)
32/s
.forEach
31/s
for..of (reduce) (destructuring)
31/s
.map (destructuring)
30/s

Fastest: for..of (1.4x faster)

View exact numbers
  • for..of: 42 ops/sec
  • .reduce (destructuring): 36 ops/sec
  • .map: 36 ops/sec
  • for..of (destructuring): 34 ops/sec
  • for..of (reduce): 33 ops/sec
  • .reduce: 32 ops/sec
  • .for (init array): 32 ops/sec
  • .forEach: 31 ops/sec
  • for..of (reduce) (destructuring): 31 ops/sec
  • .map (destructuring): 30 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    .forEach
    for..of
    for..of (destructuring)
    .map
    .map (destructuring)
    .for (init array)
    .reduce
    .reduce (destructuring)
    for..of (reduce)
    for..of (reduce) (destructuring)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Chrome 148 on Linux
View result in a separate tab
.forEach
6/s
for..of
5/s
for..of (destructuring)
5/s
.reduce
5/s
.for (init array)
5/s
for..of (reduce)
5/s
for..of (reduce) (destructuring)
5/s
.reduce (destructuring)
5/s
.map (destructuring)
4/s
.map
4/s
View exact numbers
Test name Executions per second
.forEach 6 Ops/sec
for..of 5 Ops/sec
for..of (destructuring) 5 Ops/sec
.reduce 5 Ops/sec
.for (init array) 5 Ops/sec
for..of (reduce) 5 Ops/sec
for..of (reduce) (destructuring) 5 Ops/sec
.reduce (destructuring) 5 Ops/sec
.map (destructuring) 4 Ops/sec
.map 4 Ops/sec