Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
Chrome 66
Windows
Desktop
6 years ago
Test name Executions per second
indexOf first 11841245.0 Ops/sec
$.inArray first 3360020.8 Ops/sec
indexOf last 852317.9 Ops/sec
$.inArray last 714280.4 Ops/sec
indexOf middle 1533068.9 Ops/sec
$.inArray middle 1108698.1 Ops/sec
indexOf 516522.2 Ops/sec
$.inArray 375298.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;