Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36
Chrome 88
Windows
Desktop
3 years ago
Test name Executions per second
$.hasClass 1484179.0 Ops/sec
RegExp 5938117.5 Ops/sec
Dry RegExp 1994056.4 Ops/sec
indexOf 7120922.5 Ops/sec
classList 6071945.0 Ops/sec
hasClassString 4484802.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • $.hasClass

  • RegExp

  • Dry RegExp

  • indexOf

  • classList

  • hasClassString


;