Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203
Chrome 115
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
indexOf first 15940974.0 Ops/sec
$.inArray first 4278519.5 Ops/sec
indexOf last 15962671.0 Ops/sec
$.inArray last 3093811.8 Ops/sec
indexOf middle 16332203.0 Ops/sec
$.inArray middle 3692111.2 Ops/sec
indexOf 5472205.5 Ops/sec
$.inArray 1192112.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray