Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36
Chrome 75
Windows
Desktop
5 years ago
Test name Executions per second
indexOf first 7426111.5 Ops/sec
$.inArray first 2433695.8 Ops/sec
indexOf last 7785003.5 Ops/sec
$.inArray last 521188.7 Ops/sec
indexOf middle 6566656.0 Ops/sec
$.inArray middle 621873.4 Ops/sec
indexOf 2515232.8 Ops/sec
$.inArray 278532.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray