Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36
Chrome 75
Mac OS X 10.14.0
Desktop
5 years ago
Test name Executions per second
$.hasClass 1150292.5 Ops/sec
RegExp 4952645.0 Ops/sec
Dry RegExp 1654797.9 Ops/sec
indexOf 5855346.0 Ops/sec
classList 4579295.0 Ops/sec
hasClassString 3496331.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • $.hasClass

  • RegExp

  • Dry RegExp

  • indexOf

  • classList

  • hasClassString