Run details:
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Chrome 62
Windows 7
Other
2025 years ago
Test name Executions per second
indexOf first 4394406.5 Ops/sec
$.inArray first 1747633.4 Ops/sec
indexOf last 452362.6 Ops/sec
$.inArray last 392146.2 Ops/sec
indexOf middle 819724.9 Ops/sec
$.inArray middle 639050.0 Ops/sec
indexOf 278442.4 Ops/sec
$.inArray 218888.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray