Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.100 Safari/537.36
Chrome 80
Mac OS X 10.13.6
Desktop
4 years ago
Test name Executions per second
indexOf first 90014920.0 Ops/sec
$.inArray first 24643312.0 Ops/sec
indexOf last 351027.6 Ops/sec
$.inArray last 397774.3 Ops/sec
indexOf middle 504075.9 Ops/sec
$.inArray middle 975747.9 Ops/sec
indexOf 285182.2 Ops/sec
$.inArray 211563.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray