Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Chrome 102
Windows
Desktop
2 years ago
Test name Executions per second
indexOf first 7985179.5 Ops/sec
$.inArray first 2586555.5 Ops/sec
indexOf last 8001416.5 Ops/sec
$.inArray last 425440.9 Ops/sec
indexOf middle 7986022.0 Ops/sec
$.inArray middle 730917.5 Ops/sec
indexOf 2684724.8 Ops/sec
$.inArray 252999.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray