Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36
Chrome 100
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 4749343.0 Ops/sec
$.inArray first 1758669.9 Ops/sec
indexOf last 5853393.0 Ops/sec
$.inArray last 529370.8 Ops/sec
indexOf middle 8048874.0 Ops/sec
$.inArray middle 571850.7 Ops/sec
indexOf 2556296.8 Ops/sec
$.inArray 322157.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray