Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Chrome 105
Linux
Desktop
2 years ago
Test name Executions per second
indexOf first 12958596.0 Ops/sec
$.inArray first 3470061.2 Ops/sec
indexOf last 12876502.0 Ops/sec
$.inArray last 2528872.2 Ops/sec
indexOf middle 13321733.0 Ops/sec
$.inArray middle 3093892.5 Ops/sec
indexOf 4447867.5 Ops/sec
$.inArray 995520.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray