Run details:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Firefox 52
Windows 7
Other
6 years ago
Test name Executions per second
indexOf first 46810712.0 Ops/sec
$.inArray first 20689478.0 Ops/sec
indexOf last 1013304.6 Ops/sec
$.inArray last 994349.6 Ops/sec
indexOf middle 2002342.5 Ops/sec
$.inArray middle 1882099.6 Ops/sec
indexOf 667158.8 Ops/sec
$.inArray 565428.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray