Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
Firefox 87
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 52263552.0 Ops/sec
$.inArray first 13326212.0 Ops/sec
indexOf last 259537.5 Ops/sec
$.inArray last 264294.0 Ops/sec
indexOf middle 523720.9 Ops/sec
$.inArray middle 469574.8 Ops/sec
indexOf 157421.3 Ops/sec
$.inArray 151172.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray