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 13436641.0 Ops/sec
$.inArray first 3601492.5 Ops/sec
indexOf last 13753942.0 Ops/sec
$.inArray last 695993.9 Ops/sec
indexOf middle 13801895.0 Ops/sec
$.inArray middle 1152842.0 Ops/sec
indexOf 4454121.0 Ops/sec
$.inArray 382903.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray