Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36
Chrome 69
Linux
Desktop
6 years ago
Test name Executions per second
indexOf first 7474564.0 Ops/sec
$.inArray first 2111315.2 Ops/sec
indexOf last 7498507.0 Ops/sec
$.inArray last 299812.4 Ops/sec
indexOf middle 7478259.5 Ops/sec
$.inArray middle 578557.4 Ops/sec
indexOf 2449593.2 Ops/sec
$.inArray 182123.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray