Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Firefox 93
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 40894352.0 Ops/sec
$.inArray first 9869409.0 Ops/sec
indexOf last 259533.7 Ops/sec
$.inArray last 250557.8 Ops/sec
indexOf middle 511691.2 Ops/sec
$.inArray middle 493568.8 Ops/sec
indexOf 180894.5 Ops/sec
$.inArray 167675.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;