Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0
Firefox 69
Mac OS X 10.14
Desktop
4 years ago
Test name Executions per second
indexOf first 133329568.0 Ops/sec
$.inArray first 19663920.0 Ops/sec
indexOf last 1050749.1 Ops/sec
$.inArray last 1007152.9 Ops/sec
indexOf middle 1983987.8 Ops/sec
$.inArray middle 1803746.6 Ops/sec
indexOf 629969.2 Ops/sec
$.inArray 575943.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray