Run details:
Mozilla/5.0 (Windows NT 6.1; rv:62.0) Gecko/20100101 Firefox/62.0
Firefox 62
Windows 7
Desktop
6 years ago
Test name Executions per second
indexOf first 37174840.0 Ops/sec
$.inArray first 5762181.5 Ops/sec
indexOf last 314052.7 Ops/sec
$.inArray last 297990.3 Ops/sec
indexOf middle 618107.5 Ops/sec
$.inArray middle 557314.5 Ops/sec
indexOf 207526.8 Ops/sec
$.inArray 186650.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray