Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Windows
Desktop
one year ago
Test name Executions per second
indexOf first 36684244.0 Ops/sec
$.inArray first 11278566.0 Ops/sec
indexOf last 502910.9 Ops/sec
$.inArray last 542963.5 Ops/sec
indexOf middle 1107448.2 Ops/sec
$.inArray middle 1131729.0 Ops/sec
indexOf 416806.0 Ops/sec
$.inArray 414392.6 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray