Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Firefox 78
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 124060944.0 Ops/sec
$.inArray first 39969924.0 Ops/sec
indexOf last 636648.8 Ops/sec
$.inArray last 759043.6 Ops/sec
indexOf middle 1498826.0 Ops/sec
$.inArray middle 1308782.8 Ops/sec
indexOf 483878.1 Ops/sec
$.inArray 554203.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray