Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0
Firefox 74
Ubuntu
Desktop
4 years ago
Test name Executions per second
indexOf first 125505288.0 Ops/sec
$.inArray first 56237576.0 Ops/sec
indexOf last 592537.2 Ops/sec
$.inArray last 981540.9 Ops/sec
indexOf middle 1296978.4 Ops/sec
$.inArray middle 1428587.2 Ops/sec
indexOf 571004.6 Ops/sec
$.inArray 338688.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray