HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 21 community runs

Desktop Results:
Chrome 15 runs
array indexOf
11.1M/s
_.indexOf
4.6M/s

Fastest: array indexOf (2.4x faster)

View exact numbers
  • array indexOf: 11,075,443 ops/sec
  • _.indexOf: 4,550,886 ops/sec
Firefox 6 runs
_.indexOf
66.4M/s
array indexOf
64.1M/s
View exact numbers
  • _.indexOf: 66,448,936 ops/sec
  • array indexOf: 64,136,240 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
    _.indexOf
    array indexOf

    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_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15
Safari 17 on Mac OS X 10.15.7
View result in a separate tab
array indexOf
598.7M/s
_.indexOf
29.3M/s
View exact numbers
Test name Executions per second
array indexOf 598,741,248 Ops/sec
_.indexOf 29,256,732 Ops/sec