Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Chrome 92
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 16549819.0 Ops/sec
$.inArray first 5462877.0 Ops/sec
indexOf last 16423466.0 Ops/sec
$.inArray last 978979.1 Ops/sec
indexOf middle 16404628.0 Ops/sec
$.inArray middle 1663023.0 Ops/sec
indexOf 5458612.0 Ops/sec
$.inArray 546778.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray