Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36
Chrome 77
Windows
Desktop
5 years ago
Test name Executions per second
indexOf first 13641294.0 Ops/sec
$.inArray first 4118307.5 Ops/sec
indexOf last 13723048.0 Ops/sec
$.inArray last 705775.9 Ops/sec
indexOf middle 13729400.0 Ops/sec
$.inArray middle 1198255.2 Ops/sec
indexOf 4589188.0 Ops/sec
$.inArray 392416.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray