Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
Chrome 83
Linux
Desktop
4 years ago
Test name Executions per second
$.hasClass 286367.3 Ops/sec
RegExp 1375648.4 Ops/sec
Dry RegExp 694102.0 Ops/sec
indexOf 2029428.0 Ops/sec
classList 1358892.2 Ops/sec
hasClassString 396579.4 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • $.hasClass

  • RegExp

  • Dry RegExp

  • indexOf

  • classList

  • hasClassString