Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Chrome 116
Windows
Desktop
one year ago
Test name Executions per second
indexOf first 15514964.0 Ops/sec
$.inArray first 4777415.5 Ops/sec
indexOf last 15685101.0 Ops/sec
$.inArray last 2973142.5 Ops/sec
indexOf middle 15341393.0 Ops/sec
$.inArray middle 3524873.5 Ops/sec
indexOf 5363480.0 Ops/sec
$.inArray 1193611.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray