Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Chrome 99
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 8651579.0 Ops/sec
$.inArray first 2796163.0 Ops/sec
indexOf last 8799586.0 Ops/sec
$.inArray last 434544.7 Ops/sec
indexOf middle 8869574.0 Ops/sec
$.inArray middle 752720.9 Ops/sec
indexOf 2943976.0 Ops/sec
$.inArray 258625.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;