Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15
Safari 12
Mac OS X 10.14.4
Desktop
5 years ago
Test name Executions per second
indexOf first 7906106.5 Ops/sec
$.inArray first 2721102.5 Ops/sec
indexOf last 1643822.9 Ops/sec
$.inArray last 1161423.4 Ops/sec
indexOf middle 3379395.5 Ops/sec
$.inArray middle 1449935.8 Ops/sec
indexOf 884723.6 Ops/sec
$.inArray 490830.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray