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 164053824.0 Ops/sec
$.inArray first 74616392.0 Ops/sec
indexOf last 1095480.9 Ops/sec
$.inArray last 1161147.2 Ops/sec
indexOf middle 2062209.1 Ops/sec
$.inArray middle 2200725.2 Ops/sec
indexOf 610999.6 Ops/sec
$.inArray 666590.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;