Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 64863664.0 Ops/sec
$.inArray first 15627930.0 Ops/sec
indexOf last 293130.1 Ops/sec
$.inArray last 282607.0 Ops/sec
indexOf middle 461059.7 Ops/sec
$.inArray middle 466730.0 Ops/sec
indexOf 132713.8 Ops/sec
$.inArray 159450.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;