Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Firefox 72
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 148876576.0 Ops/sec
$.inArray first 70930728.0 Ops/sec
indexOf last 1061460.8 Ops/sec
$.inArray last 1044293.8 Ops/sec
indexOf middle 2011555.9 Ops/sec
$.inArray middle 2107745.8 Ops/sec
indexOf 638891.6 Ops/sec
$.inArray 679679.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray