Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36
Yandex Browser 24
Windows
Desktop
11 months ago
Test name Executions per second
indexOf first 17294164.0 Ops/sec
$.inArray first 5478915.5 Ops/sec
indexOf last 17406976.0 Ops/sec
$.inArray last 3158972.2 Ops/sec
indexOf middle 17316862.0 Ops/sec
$.inArray middle 3923695.8 Ops/sec
indexOf 6268153.5 Ops/sec
$.inArray 1352224.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray