Script Preparation code:
Tests:

Historical Performance Data aggregated from 219 community runs

Desktop Results:
Chrome 166 runs
findIndex
1K/s
for loop
501/s

Fastest: findIndex (2.6x faster)

View exact numbers
  • findIndex: 1,316 ops/sec
  • for loop: 501 ops/sec
Firefox 40 runs
for loop
58K/s
findIndex
12K/s

Fastest: for loop (5.0x faster)

View exact numbers
  • for loop: 58,255 ops/sec
  • findIndex: 11,718 ops/sec
Mobile Results:
Safari 8 runs
findIndex
2K/s
for loop
782/s

Fastest: findIndex (2.4x faster)

View exact numbers
  • findIndex: 1,873 ops/sec
  • for loop: 782 ops/sec
Chrome 5 runs
findIndex
797/s
for loop
311/s

Fastest: findIndex (2.6x faster)

View exact numbers
  • findIndex: 797 ops/sec
  • for loop: 311 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
    findIndex
    for loop

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Chrome 146 on Linux
View result in a separate tab
for loop
12K/s
findIndex
5K/s
View exact numbers
Test name Executions per second
for loop 12,111 Ops/sec
findIndex 5,065 Ops/sec