Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.94 Safari/537.36
Chrome 79
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 10879076.0 Ops/sec
$.inArray first 3482379.2 Ops/sec
indexOf last 10759916.0 Ops/sec
$.inArray last 563340.1 Ops/sec
indexOf middle 10838111.0 Ops/sec
$.inArray middle 964277.4 Ops/sec
indexOf 3617868.5 Ops/sec
$.inArray 313734.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray