Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
Firefox 62
Ubuntu
Desktop
6 years ago
Test name Executions per second
indexOf first 82282680.0 Ops/sec
$.inArray first 15358958.0 Ops/sec
indexOf last 778110.2 Ops/sec
$.inArray last 749716.1 Ops/sec
indexOf middle 1320023.9 Ops/sec
$.inArray middle 1127390.2 Ops/sec
indexOf 176577.4 Ops/sec
$.inArray 310736.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray