Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
Chrome 91
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 18750524.0 Ops/sec
$.inArray first 5057302.5 Ops/sec
indexOf last 18632722.0 Ops/sec
$.inArray last 939180.4 Ops/sec
indexOf middle 18593718.0 Ops/sec
$.inArray middle 1576683.0 Ops/sec
indexOf 6072038.0 Ops/sec
$.inArray 518953.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;