Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Chrome 65
Windows
Other
2025 years ago
Test name Executions per second
indexOf first 10678153.0 Ops/sec
$.inArray first 3303908.0 Ops/sec
indexOf last 763801.9 Ops/sec
$.inArray last 637583.4 Ops/sec
indexOf middle 1388341.5 Ops/sec
$.inArray middle 1053564.4 Ops/sec
indexOf 444331.3 Ops/sec
$.inArray 349074.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;