Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3285.0 Safari/537.36
Chrome 65
Windows 7
Other
6 years ago
Test name Executions per second
indexOf first 5212821.0 Ops/sec
$.inArray first 1722813.9 Ops/sec
indexOf last 411722.9 Ops/sec
$.inArray last 343814.9 Ops/sec
indexOf middle 754954.7 Ops/sec
$.inArray middle 570898.0 Ops/sec
indexOf 255097.5 Ops/sec
$.inArray 193547.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;