Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36
Chrome 93
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 10520936.0 Ops/sec
$.inArray first 3348866.8 Ops/sec
indexOf last 10573831.0 Ops/sec
$.inArray last 350681.0 Ops/sec
indexOf middle 10483299.0 Ops/sec
$.inArray middle 622286.2 Ops/sec
indexOf 3625497.5 Ops/sec
$.inArray 214652.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray