Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Chrome 79
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 7019452.5 Ops/sec
$.inArray first 1977785.2 Ops/sec
indexOf last 7093920.5 Ops/sec
$.inArray last 493093.8 Ops/sec
indexOf middle 7385858.0 Ops/sec
$.inArray middle 790327.8 Ops/sec
indexOf 2445368.0 Ops/sec
$.inArray 239532.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;