Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69
Mac OS X 10.13.6
Desktop
6 years ago
Test name Executions per second
indexOf first 11386614.0 Ops/sec
$.inArray first 2990897.5 Ops/sec
indexOf last 11299897.0 Ops/sec
$.inArray last 547913.6 Ops/sec
indexOf middle 11236353.0 Ops/sec
$.inArray middle 959985.4 Ops/sec
indexOf 3824530.2 Ops/sec
$.inArray 302303.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray