Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Chrome 92
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 7979000.0 Ops/sec
$.inArray first 2452917.2 Ops/sec
indexOf last 7968025.0 Ops/sec
$.inArray last 377194.0 Ops/sec
indexOf middle 8058517.5 Ops/sec
$.inArray middle 664699.2 Ops/sec
indexOf 2702470.2 Ops/sec
$.inArray 227624.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray