Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Firefox 60
Windows
Desktop
6 years ago
Test name Executions per second
indexOf first 121805720.0 Ops/sec
$.inArray first 16259841.0 Ops/sec
indexOf last 1181557.4 Ops/sec
$.inArray last 1083621.1 Ops/sec
indexOf middle 2228390.0 Ops/sec
$.inArray middle 1692344.2 Ops/sec
indexOf 720049.1 Ops/sec
$.inArray 680994.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray