Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
Chrome 75
Mac OS X 10.14.0
Desktop
5 years ago
Test name Executions per second
indexOf first 12342845.0 Ops/sec
$.inArray first 3866707.8 Ops/sec
indexOf last 12386566.0 Ops/sec
$.inArray last 715720.1 Ops/sec
indexOf middle 12775701.0 Ops/sec
$.inArray middle 1125679.8 Ops/sec
indexOf 4237832.0 Ops/sec
$.inArray 387326.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray