Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36
Chrome 81
Windows
Desktop
4 years ago
Test name Executions per second
indexOf first 7830849.0 Ops/sec
$.inArray first 2524635.8 Ops/sec
indexOf last 7927337.5 Ops/sec
$.inArray last 440615.8 Ops/sec
indexOf middle 7993837.5 Ops/sec
$.inArray middle 751838.9 Ops/sec
indexOf 2562000.8 Ops/sec
$.inArray 255302.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray