Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0
Firefox 90
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 47328404.0 Ops/sec
$.inArray first 12307046.0 Ops/sec
indexOf last 303616.0 Ops/sec
$.inArray last 293833.8 Ops/sec
indexOf middle 610507.8 Ops/sec
$.inArray middle 552297.6 Ops/sec
indexOf 207070.4 Ops/sec
$.inArray 195216.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray