Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:87.0) Gecko/20100101 Firefox/87.0
Firefox 87
Mac OS X 10.14
Desktop
3 years ago
Test name Executions per second
indexOf first 62350336.0 Ops/sec
$.inArray first 16312822.0 Ops/sec
indexOf last 297373.0 Ops/sec
$.inArray last 288839.0 Ops/sec
indexOf middle 559408.2 Ops/sec
$.inArray middle 586748.5 Ops/sec
indexOf 190514.0 Ops/sec
$.inArray 199563.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray