Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36
Chrome 99
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 9386523.0 Ops/sec
$.inArray first 2915226.0 Ops/sec
indexOf last 9413090.0 Ops/sec
$.inArray last 366622.6 Ops/sec
indexOf middle 9266117.0 Ops/sec
$.inArray middle 643588.1 Ops/sec
indexOf 3001775.5 Ops/sec
$.inArray 225766.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;