Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15
Safari 13
Mac OS X 10.15
Desktop
5 years ago
Test name Executions per second
indexOf first 11535346.0 Ops/sec
$.inArray first 3866678.5 Ops/sec
indexOf last 1710302.8 Ops/sec
$.inArray last 1526424.0 Ops/sec
indexOf middle 5275273.5 Ops/sec
$.inArray middle 2165685.2 Ops/sec
indexOf 1019819.1 Ops/sec
$.inArray 725304.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray