Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Chrome 125
Mac OS X 10.15.7
Desktop
7 months ago
Test name Executions per second
indexOf first 11489034.0 Ops/sec
$.inArray first 4041010.8 Ops/sec
indexOf last 5581249.5 Ops/sec
$.inArray last 2954663.0 Ops/sec
indexOf middle 7593481.0 Ops/sec
$.inArray middle 3419380.5 Ops/sec
indexOf 2737757.2 Ops/sec
$.inArray 1169892.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray