Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69
Mac OS X 10.13.6
Desktop
6 years ago
Test name Executions per second
indexOf first 14619137.0 Ops/sec
$.inArray first 4048501.8 Ops/sec
indexOf last 14810787.0 Ops/sec
$.inArray last 757996.6 Ops/sec
indexOf middle 14853513.0 Ops/sec
$.inArray middle 1283628.8 Ops/sec
indexOf 4968081.5 Ops/sec
$.inArray 416153.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray