Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69
Windows
Desktop
6 years ago
Test name Executions per second
indexOf first 7807653.5 Ops/sec
$.inArray first 2406264.2 Ops/sec
indexOf last 8807333.0 Ops/sec
$.inArray last 444592.1 Ops/sec
indexOf middle 7221268.0 Ops/sec
$.inArray middle 848517.7 Ops/sec
indexOf 2777752.2 Ops/sec
$.inArray 280901.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray