Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Chrome 97
Linux
Desktop
2 years ago
Test name Executions per second
indexOf first 24605736.0 Ops/sec
$.inArray first 7726973.0 Ops/sec
indexOf last 24716432.0 Ops/sec
$.inArray last 1066290.1 Ops/sec
indexOf middle 24793814.0 Ops/sec
$.inArray middle 1842020.0 Ops/sec
indexOf 8341300.5 Ops/sec
$.inArray 604893.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray