Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
Firefox 87
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 103721536.0 Ops/sec
$.inArray first 22677444.0 Ops/sec
indexOf last 601263.7 Ops/sec
$.inArray last 591719.3 Ops/sec
indexOf middle 1189766.6 Ops/sec
$.inArray middle 1146163.4 Ops/sec
indexOf 393273.8 Ops/sec
$.inArray 382348.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;