Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
Chrome 66
Linux
Other
6 years ago
Test name Executions per second
indexOf first 11012314.0 Ops/sec
$.inArray first 3537519.8 Ops/sec
indexOf last 859204.2 Ops/sec
$.inArray last 735887.7 Ops/sec
indexOf middle 1566942.1 Ops/sec
$.inArray middle 1179670.1 Ops/sec
indexOf 523368.2 Ops/sec
$.inArray 390237.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray