Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Firefox 121
Windows
Desktop
11 months ago
Test name Executions per second
indexOf first 66996732.0 Ops/sec
$.inArray first 24185158.0 Ops/sec
indexOf last 1309645.6 Ops/sec
$.inArray last 1265526.1 Ops/sec
indexOf middle 2563085.5 Ops/sec
$.inArray middle 2390201.2 Ops/sec
indexOf 860181.1 Ops/sec
$.inArray 813529.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray