Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Chrome 97
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 11650952.0 Ops/sec
$.inArray first 3794631.2 Ops/sec
indexOf last 12138001.0 Ops/sec
$.inArray last 644472.8 Ops/sec
indexOf middle 11884563.0 Ops/sec
$.inArray middle 1111107.5 Ops/sec
indexOf 4023158.0 Ops/sec
$.inArray 338328.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray