Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
Chrome 64
Linux
Desktop
5 years ago
Test name Executions per second
indexOf first 10840579.0 Ops/sec
$.inArray first 3076441.2 Ops/sec
indexOf last 792952.1 Ops/sec
$.inArray last 663529.4 Ops/sec
indexOf middle 1459487.4 Ops/sec
$.inArray middle 1054787.6 Ops/sec
indexOf 480532.9 Ops/sec
$.inArray 351180.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray