Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Chrome 97
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 9544692.0 Ops/sec
$.inArray first 3066650.2 Ops/sec
indexOf last 9468892.0 Ops/sec
$.inArray last 368742.1 Ops/sec
indexOf middle 9639321.0 Ops/sec
$.inArray middle 670179.4 Ops/sec
indexOf 3213329.2 Ops/sec
$.inArray 229117.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;