Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Chrome 65
Mac OS X 10.12.6
Other
2025 years ago
Test name Executions per second
indexOf first 9240250.0 Ops/sec
$.inArray first 2999984.2 Ops/sec
indexOf last 716026.7 Ops/sec
$.inArray last 600372.6 Ops/sec
indexOf middle 1302426.8 Ops/sec
$.inArray middle 988019.4 Ops/sec
indexOf 422027.8 Ops/sec
$.inArray 321890.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;