Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69
Windows
Desktop
6 years ago
Test name Executions per second
indexOf first 10468509.0 Ops/sec
$.inArray first 2611303.2 Ops/sec
indexOf last 10327216.0 Ops/sec
$.inArray last 578775.4 Ops/sec
indexOf middle 10249482.0 Ops/sec
$.inArray middle 922991.3 Ops/sec
indexOf 3354273.5 Ops/sec
$.inArray 302342.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;