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 Edg/107.0.1418.52
Chrome 107
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 11547619.0 Ops/sec
$.inArray first 3865859.2 Ops/sec
indexOf last 10737640.0 Ops/sec
$.inArray last 726467.0 Ops/sec
indexOf middle 11973331.0 Ops/sec
$.inArray middle 1219721.9 Ops/sec
indexOf 3940099.8 Ops/sec
$.inArray 394413.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray