Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76
Windows
Desktop
5 years ago
Test name Executions per second
indexOf first 7422908.0 Ops/sec
$.inArray first 2177398.8 Ops/sec
indexOf last 7451964.0 Ops/sec
$.inArray last 385694.1 Ops/sec
indexOf middle 6085897.0 Ops/sec
$.inArray middle 733726.4 Ops/sec
indexOf 2412638.2 Ops/sec
$.inArray 241741.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray