Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Chrome 71
Windows
Desktop
5 years ago
Test name Executions per second
indexOf first 13243194.0 Ops/sec
$.inArray first 3982925.8 Ops/sec
indexOf last 13267584.0 Ops/sec
$.inArray last 742933.8 Ops/sec
indexOf middle 13211161.0 Ops/sec
$.inArray middle 1242395.8 Ops/sec
indexOf 4460528.0 Ops/sec
$.inArray 415989.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;