Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
IE 11
Windows
Desktop
6 years ago
Test name Executions per second
indexOf first 23041160.0 Ops/sec
$.inArray first 7201224.5 Ops/sec
indexOf last 77484.0 Ops/sec
$.inArray last 77378.3 Ops/sec
indexOf middle 153398.8 Ops/sec
$.inArray middle 151948.4 Ops/sec
indexOf 51767.7 Ops/sec
$.inArray 49974.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray