Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0
Firefox 82
Mac OS X 10.15
Desktop
4 years ago
Test name Executions per second
indexOf first 127290376.0 Ops/sec
$.inArray first 69730576.0 Ops/sec
indexOf last 676882.4 Ops/sec
$.inArray last 1075752.0 Ops/sec
indexOf middle 1323277.1 Ops/sec
$.inArray middle 1923647.2 Ops/sec
indexOf 410849.1 Ops/sec
$.inArray 499554.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray