Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36
Chrome 93
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
indexOf first 11848269.0 Ops/sec
$.inArray first 3736371.8 Ops/sec
indexOf last 13254306.0 Ops/sec
$.inArray last 366934.0 Ops/sec
indexOf middle 12674486.0 Ops/sec
$.inArray middle 640952.7 Ops/sec
indexOf 3720249.5 Ops/sec
$.inArray 195402.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray