Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Firefox 63
Linux
Desktop
6 years ago
Test name Executions per second
indexOf first 93512840.0 Ops/sec
$.inArray first 17405252.0 Ops/sec
indexOf last 755668.1 Ops/sec
$.inArray last 710961.4 Ops/sec
indexOf middle 1448023.5 Ops/sec
$.inArray middle 1361466.4 Ops/sec
indexOf 492731.8 Ops/sec
$.inArray 445692.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray