Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Firefox 57
Windows
Other
2025 years ago
Test name Executions per second
$.hasClass 3212097.2 Ops/sec
RegExp 12963422.0 Ops/sec
Dry RegExp 1887552.9 Ops/sec
indexOf 9834131.0 Ops/sec
classList 17690566.0 Ops/sec
hasClassString 13956334.0 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • $.hasClass

  • RegExp

  • Dry RegExp

  • indexOf

  • classList

  • hasClassString


;