Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 12164646.0 Ops/sec
$.inArray first 3337390.0 Ops/sec
indexOf last 12355604.0 Ops/sec
$.inArray last 2091019.4 Ops/sec
indexOf middle 12290895.0 Ops/sec
$.inArray middle 2529451.0 Ops/sec
indexOf 4144560.8 Ops/sec
$.inArray 846731.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray