Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0
Firefox 71
Ubuntu
Desktop
4 years ago
Test name Executions per second
indexOf first 105743048.0 Ops/sec
$.inArray first 17483848.0 Ops/sec
indexOf last 810806.7 Ops/sec
$.inArray last 781309.4 Ops/sec
indexOf middle 1572388.8 Ops/sec
$.inArray middle 1447204.2 Ops/sec
indexOf 531543.8 Ops/sec
$.inArray 503607.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray