Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0
Firefox 88
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 78967832.0 Ops/sec
$.inArray first 12172989.0 Ops/sec
indexOf last 391263.7 Ops/sec
$.inArray last 397826.1 Ops/sec
indexOf middle 793986.7 Ops/sec
$.inArray middle 757051.5 Ops/sec
indexOf 256244.5 Ops/sec
$.inArray 295444.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;