Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Chrome 85
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 8219447.5 Ops/sec
$.inArray first 2553841.5 Ops/sec
indexOf last 8168501.5 Ops/sec
$.inArray last 532208.2 Ops/sec
indexOf middle 8135555.5 Ops/sec
$.inArray middle 857985.4 Ops/sec
indexOf 2778358.5 Ops/sec
$.inArray 262577.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;