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 80331360.0 Ops/sec
$.inArray first 19535006.0 Ops/sec
indexOf last 659427.1 Ops/sec
$.inArray last 674991.4 Ops/sec
indexOf middle 1409645.1 Ops/sec
$.inArray middle 1324202.6 Ops/sec
indexOf 442216.3 Ops/sec
$.inArray 435188.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray