Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36
Chrome 102
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 7944752.0 Ops/sec
$.inArray first 2382038.8 Ops/sec
indexOf last 8017105.0 Ops/sec
$.inArray last 443621.7 Ops/sec
indexOf middle 8029858.5 Ops/sec
$.inArray middle 740750.5 Ops/sec
indexOf 2679557.0 Ops/sec
$.inArray 257768.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray