Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0
Firefox 77
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 143238032.0 Ops/sec
$.inArray first 67571136.0 Ops/sec
indexOf last 664566.1 Ops/sec
$.inArray last 1121138.6 Ops/sec
indexOf middle 1298992.8 Ops/sec
$.inArray middle 1564676.2 Ops/sec
indexOf 598493.4 Ops/sec
$.inArray 437882.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;