Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0
Firefox 103
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 66305380.0 Ops/sec
$.inArray first 18375380.0 Ops/sec
indexOf last 1226713.1 Ops/sec
$.inArray last 1137584.2 Ops/sec
indexOf middle 2222112.0 Ops/sec
$.inArray middle 2094722.6 Ops/sec
indexOf 815138.3 Ops/sec
$.inArray 763728.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray