Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 Safari/604.1
Mobile Safari 14
iOS 14.5
Mobile
3 years ago
Test name Executions per second
indexOf first 13997215.0 Ops/sec
$.inArray first 4179672.8 Ops/sec
indexOf last 1824209.2 Ops/sec
$.inArray last 1482036.5 Ops/sec
indexOf middle 2916443.5 Ops/sec
$.inArray middle 2131614.5 Ops/sec
indexOf 1029850.5 Ops/sec
$.inArray 611431.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray