Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Chrome 81
Windows
Desktop
4 years ago
Test name Executions per second
$.hasClass 775723.7 Ops/sec
RegExp 3198334.0 Ops/sec
Dry RegExp 1133286.2 Ops/sec
indexOf 3894053.8 Ops/sec
classList 3127507.8 Ops/sec
hasClassString 2306284.0 Ops/sec
indexOf more than operator 3855921.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • $.hasClass

  • RegExp

  • Dry RegExp

  • indexOf

  • classList

  • hasClassString

  • indexOf more than operator