Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
Chrome 80
Linux
Desktop
4 years ago
Test name Executions per second
indexOf first 13996057.0 Ops/sec
$.inArray first 4060673.2 Ops/sec
indexOf last 13335655.0 Ops/sec
$.inArray last 847321.9 Ops/sec
indexOf middle 13488834.0 Ops/sec
$.inArray middle 1411531.4 Ops/sec
indexOf 4807204.0 Ops/sec
$.inArray 471018.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray