Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Firefox 63
Windows
Desktop
6 years ago
Test name Executions per second
indexOf first 120332392.0 Ops/sec
$.inArray first 14775350.0 Ops/sec
indexOf last 710772.2 Ops/sec
$.inArray last 630465.5 Ops/sec
indexOf middle 1413015.4 Ops/sec
$.inArray middle 1356664.5 Ops/sec
indexOf 480529.1 Ops/sec
$.inArray 500617.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray