Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0
Firefox 60
Mac OS X 10.13
Desktop
6 years ago
Test name Executions per second
indexOf first 120038968.0 Ops/sec
$.inArray first 16771121.0 Ops/sec
indexOf last 1184468.4 Ops/sec
$.inArray last 1066188.4 Ops/sec
indexOf middle 2290835.8 Ops/sec
$.inArray middle 1956574.4 Ops/sec
indexOf 745475.9 Ops/sec
$.inArray 663220.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray