Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Firefox/78.0
Firefox 78
Mac OS X 10.13
Desktop
4 years ago
Test name Executions per second
indexOf first 147148928.0 Ops/sec
$.inArray first 62693156.0 Ops/sec
indexOf last 1201554.6 Ops/sec
$.inArray last 1177681.1 Ops/sec
indexOf middle 2312352.0 Ops/sec
$.inArray middle 2256407.5 Ops/sec
indexOf 777135.1 Ops/sec
$.inArray 763833.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray