Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Chrome 83
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 8831749.0 Ops/sec
$.inArray first 2778388.2 Ops/sec
indexOf last 8529347.0 Ops/sec
$.inArray last 607847.6 Ops/sec
indexOf middle 8837259.0 Ops/sec
$.inArray middle 1040738.1 Ops/sec
indexOf 2961831.2 Ops/sec
$.inArray 320129.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray