Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Chrome 76
Windows
Desktop
5 years ago
Test name Executions per second
indexOf first 11486299.0 Ops/sec
$.inArray first 3590033.0 Ops/sec
indexOf last 11780155.0 Ops/sec
$.inArray last 686808.1 Ops/sec
indexOf middle 12165493.0 Ops/sec
$.inArray middle 1141586.0 Ops/sec
indexOf 4018842.5 Ops/sec
$.inArray 370645.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray


;