Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Windows
Desktop
2 months ago
Test name Executions per second
indexOf first 16080421.0 Ops/sec
$.inArray first 5051052.0 Ops/sec
indexOf last 5198373.5 Ops/sec
$.inArray last 3019277.0 Ops/sec
indexOf middle 7524713.5 Ops/sec
$.inArray middle 3758826.5 Ops/sec
indexOf 2697540.5 Ops/sec
$.inArray 1277799.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • indexOf first

  • $.inArray first

  • indexOf last

  • $.inArray last

  • indexOf middle

  • $.inArray middle

  • indexOf

  • $.inArray