Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Chrome 92
Windows
Desktop
3 years ago
Test name Executions per second
indexOf first 12439729.0 Ops/sec
$.inArray first 4002356.8 Ops/sec
indexOf last 13165302.0 Ops/sec
$.inArray last 784615.9 Ops/sec
indexOf middle 13112257.0 Ops/sec
$.inArray middle 1342256.6 Ops/sec
indexOf 4413907.5 Ops/sec
$.inArray 418126.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;