Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Chrome 79
Linux
Desktop
4 years ago
Test name Executions per second
indexOf first 8767293.0 Ops/sec
$.inArray first 2703611.5 Ops/sec
indexOf last 8871455.0 Ops/sec
$.inArray last 291807.8 Ops/sec
indexOf middle 8945022.0 Ops/sec
$.inArray middle 520678.5 Ops/sec
indexOf 3002944.8 Ops/sec
$.inArray 180966.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray