Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Chrome 97
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
indexOf first 15549423.0 Ops/sec
$.inArray first 4824552.5 Ops/sec
indexOf last 15297102.0 Ops/sec
$.inArray last 431653.0 Ops/sec
indexOf middle 15660520.0 Ops/sec
$.inArray middle 802166.2 Ops/sec
indexOf 5334142.5 Ops/sec
$.inArray 273319.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray