Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Chrome 70
Linux
Desktop
6 years ago
Test name Executions per second
indexOf first 10112699.0 Ops/sec
$.inArray first 2687850.5 Ops/sec
indexOf last 10634069.0 Ops/sec
$.inArray last 389361.7 Ops/sec
indexOf middle 10087953.0 Ops/sec
$.inArray middle 675977.4 Ops/sec
indexOf 3326842.0 Ops/sec
$.inArray 233989.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray