Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36
Chrome 70
Mac OS X 10.13.4
Desktop
6 years ago
Test name Executions per second
indexOf first 14169976.0 Ops/sec
$.inArray first 3840950.2 Ops/sec
indexOf last 14005733.0 Ops/sec
$.inArray last 643305.9 Ops/sec
indexOf middle 13990892.0 Ops/sec
$.inArray middle 1083117.8 Ops/sec
indexOf 4677932.5 Ops/sec
$.inArray 352662.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray