Run details:
Mozilla/5.0 (Linux; Android 8.1.0; ONEPLUS A5010 Build/OPM1.171019.011) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36
Chrome Mobile 69
Android 8.1.0
Mobile
6 years ago
Test name Executions per second
indexOf first 5343112.0 Ops/sec
$.inArray first 1399141.6 Ops/sec
indexOf last 5029596.0 Ops/sec
$.inArray last 251745.3 Ops/sec
indexOf middle 5370586.0 Ops/sec
$.inArray middle 423628.0 Ops/sec
indexOf 1880309.9 Ops/sec
$.inArray 145314.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray