Run details:
Mozilla/5.0 (Linux; Android 9; Redmi Note 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Mobile Safari/537.36
Chrome Mobile 80
Android
Mobile
3 years ago
Test name Executions per second
indexOf first 3781947.2 Ops/sec
$.inArray first 1069914.0 Ops/sec
indexOf last 3797115.8 Ops/sec
$.inArray last 190810.2 Ops/sec
indexOf middle 3794828.5 Ops/sec
$.inArray middle 300385.4 Ops/sec
indexOf 1272077.5 Ops/sec
$.inArray 110595.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;