Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
Chrome 60
Windows
Other
7 years ago
Test name Executions per second
indexOf first 6390931.0 Ops/sec
$.inArray first 2557651.8 Ops/sec
indexOf last 663853.4 Ops/sec
$.inArray last 555679.1 Ops/sec
indexOf middle 1215141.2 Ops/sec
$.inArray middle 915818.6 Ops/sec
indexOf 420035.0 Ops/sec
$.inArray 315370.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;