Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Firefox 58
Windows
Other
2025 years ago
Test name Executions per second
indexOf first 112156848.0 Ops/sec
$.inArray first 26691566.0 Ops/sec
indexOf last 1055102.1 Ops/sec
$.inArray last 1023607.1 Ops/sec
indexOf middle 2067000.0 Ops/sec
$.inArray middle 1960476.0 Ops/sec
indexOf 700505.7 Ops/sec
$.inArray 659459.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray