Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36
Chrome 81
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 10465300.0 Ops/sec
$.inArray first 2956805.2 Ops/sec
indexOf last 10677512.0 Ops/sec
$.inArray last 716120.0 Ops/sec
indexOf middle 10581696.0 Ops/sec
$.inArray middle 1056178.9 Ops/sec
indexOf 3329637.0 Ops/sec
$.inArray 346245.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray