Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0
Firefox 80
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 180702144.0 Ops/sec
$.inArray first 75891536.0 Ops/sec
indexOf last 1103626.6 Ops/sec
$.inArray last 1065840.6 Ops/sec
indexOf middle 2103837.5 Ops/sec
$.inArray middle 2117036.0 Ops/sec
indexOf 670918.4 Ops/sec
$.inArray 597607.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray