HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 5 community runs

Desktop Results:
Chrome 5 runs
for loop (x of arr)
5K/s
Array.forEach (native)
3K/s
lodash _.each
991/s
lodash _.map (discarding result)
679/s
Array.map (native, discarding result)
617/s
for loop (indexed)
75/s

Fastest: for loop (x of arr) (72.4x faster)

View exact numbers
  • for loop (x of arr): 5,447 ops/sec
  • Array.forEach (native): 3,489 ops/sec
  • lodash _.each: 991 ops/sec
  • lodash _.map (discarding result): 679 ops/sec
  • Array.map (native, discarding result): 617 ops/sec
  • for loop (indexed): 75 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
    Array.forEach (native)
    lodash _.each
    Array.map (native, discarding result)
    lodash _.map (discarding result)
    for loop (x of arr)
    for loop (indexed)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0
Firefox 137 on Mac OS X 10.15
View result in a separate tab
for loop (indexed)
10K/s
for loop (x of arr)
4K/s
Array.forEach (native)
3K/s
lodash _.each
3K/s
Array.map (native, discarding result)
2K/s
lodash _.map (discarding result)
2K/s
View exact numbers
Test name Executions per second
for loop (indexed) 10,140 Ops/sec
for loop (x of arr) 3,546 Ops/sec
Array.forEach (native) 2,764 Ops/sec
lodash _.each 2,754 Ops/sec
Array.map (native, discarding result) 1,731 Ops/sec
lodash _.map (discarding result) 1,646 Ops/sec