Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
indexOf first 14249344.0 Ops/sec
$.inArray first 4219019.0 Ops/sec
indexOf last 14130531.0 Ops/sec
$.inArray last 3041302.0 Ops/sec
indexOf middle 14147029.0 Ops/sec
$.inArray middle 3579667.5 Ops/sec
indexOf 4915323.5 Ops/sec
$.inArray 1192970.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray