Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Firefox 60
Windows 7
Desktop
6 years ago
Test name Executions per second
indexOf first 138183888.0 Ops/sec
$.inArray first 20909016.0 Ops/sec
indexOf last 1170420.9 Ops/sec
$.inArray last 1096753.8 Ops/sec
indexOf middle 2315866.5 Ops/sec
$.inArray middle 2133860.5 Ops/sec
indexOf 779628.2 Ops/sec
$.inArray 713093.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray