Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Chrome 71
Windows 7
Desktop
5 years ago
Test name Executions per second
indexOf first 6404625.5 Ops/sec
$.inArray first 1813718.1 Ops/sec
indexOf last 6376305.0 Ops/sec
$.inArray last 271201.2 Ops/sec
indexOf middle 6372275.0 Ops/sec
$.inArray middle 531304.8 Ops/sec
indexOf 2092097.5 Ops/sec
$.inArray 161018.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;