Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36
Chrome 75
Linux
Desktop
5 years ago
Test name Executions per second
indexOf first 7470440.5 Ops/sec
$.inArray first 2223657.5 Ops/sec
indexOf last 7337397.0 Ops/sec
$.inArray last 427586.1 Ops/sec
indexOf middle 7238517.5 Ops/sec
$.inArray middle 722654.5 Ops/sec
indexOf 2815110.8 Ops/sec
$.inArray 254611.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray