Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Chrome 105
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 6306526.0 Ops/sec
$.inArray first 2078210.4 Ops/sec
indexOf last 7354011.0 Ops/sec
$.inArray last 1328072.8 Ops/sec
indexOf middle 6932696.5 Ops/sec
$.inArray middle 1345778.1 Ops/sec
indexOf 1893439.1 Ops/sec
$.inArray 432532.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray