Run details:
Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0
Firefox 61
Windows 8.1
Desktop
6 years ago
Test name Executions per second
indexOf first 107492168.0 Ops/sec
$.inArray first 15356659.0 Ops/sec
indexOf last 826972.1 Ops/sec
$.inArray last 820008.2 Ops/sec
indexOf middle 1580562.1 Ops/sec
$.inArray middle 1517882.6 Ops/sec
indexOf 571025.2 Ops/sec
$.inArray 529126.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray