Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
Chrome 78
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 8419608.0 Ops/sec
$.inArray first 2995269.0 Ops/sec
indexOf last 10477643.0 Ops/sec
$.inArray last 686071.0 Ops/sec
indexOf middle 10340798.0 Ops/sec
$.inArray middle 1066058.1 Ops/sec
indexOf 3413426.0 Ops/sec
$.inArray 354818.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;