Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
Chrome 72
Mac OS X 10.14.2
Desktop
5 years ago
Test name Executions per second
indexOf first 15456949.0 Ops/sec
$.inArray first 4328144.5 Ops/sec
indexOf last 15409953.0 Ops/sec
$.inArray last 673379.0 Ops/sec
indexOf middle 15096715.0 Ops/sec
$.inArray middle 1064292.9 Ops/sec
indexOf 5005804.0 Ops/sec
$.inArray 369908.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray