Run details:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
Firefox 49
Windows 7
Other
7 years ago
Test name Executions per second
indexOf first 75677080.0 Ops/sec
$.inArray first 33936800.0 Ops/sec
indexOf last 2297196.8 Ops/sec
$.inArray last 2197850.2 Ops/sec
indexOf middle 4405389.0 Ops/sec
$.inArray middle 4063344.2 Ops/sec
indexOf 1481240.4 Ops/sec
$.inArray 1355270.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;