Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:66.0) Gecko/20100101 Firefox/66.0
Firefox 66
Mac OS X 10.13
Desktop
5 years ago
Test name Executions per second
indexOf first 150724480.0 Ops/sec
$.inArray first 20120280.0 Ops/sec
indexOf last 947779.4 Ops/sec
$.inArray last 893330.9 Ops/sec
indexOf middle 1943091.1 Ops/sec
$.inArray middle 1702700.5 Ops/sec
indexOf 620234.8 Ops/sec
$.inArray 637701.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray