Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Chrome 70
Linux
Desktop
6 years ago
Test name Executions per second
indexOf first 10808042.0 Ops/sec
$.inArray first 2604102.0 Ops/sec
indexOf last 11180686.0 Ops/sec
$.inArray last 407319.9 Ops/sec
indexOf middle 11020135.0 Ops/sec
$.inArray middle 697757.3 Ops/sec
indexOf 3652050.2 Ops/sec
$.inArray 237859.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray