Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15
Safari 13
Mac OS X 10.14.6
Desktop
4 years ago
Test name Executions per second
indexOf first 7880587.0 Ops/sec
$.inArray first 2697361.2 Ops/sec
indexOf last 1272824.8 Ops/sec
$.inArray last 664576.1 Ops/sec
indexOf middle 2402548.8 Ops/sec
$.inArray middle 1078968.0 Ops/sec
indexOf 671868.3 Ops/sec
$.inArray 376847.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray