Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
Firefox 62
Ubuntu
Desktop
6 years ago
Test name Executions per second
indexOf first 118935072.0 Ops/sec
$.inArray first 19471866.0 Ops/sec
indexOf last 865210.1 Ops/sec
$.inArray last 829864.8 Ops/sec
indexOf middle 1692204.6 Ops/sec
$.inArray middle 1580095.2 Ops/sec
indexOf 569686.6 Ops/sec
$.inArray 528429.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray