Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Chrome 91
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 8413900.0 Ops/sec
$.inArray first 2724180.5 Ops/sec
indexOf last 9040172.0 Ops/sec
$.inArray last 443116.6 Ops/sec
indexOf middle 8860482.0 Ops/sec
$.inArray middle 763512.2 Ops/sec
indexOf 3085917.2 Ops/sec
$.inArray 249403.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;