Script Preparation code:
Tests:

Historical Performance Data aggregated from 5 community runs

Desktop Results:
Chrome 5 runs
indexOf
9.0M/s
findIndex
4.6M/s

Fastest: indexOf (2.0x faster)

View exact numbers
  • indexOf: 9,038,124 ops/sec
  • findIndex: 4,552,614 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
    indexOf

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122 on Windows
View result in a separate tab
indexOf
9.0M/s
findIndex
3.4M/s
View exact numbers
Test name Executions per second
indexOf 9,020,249 Ops/sec
findIndex 3,410,205 Ops/sec