Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Chrome 71
Windows
Desktop
5 years ago
Test name Executions per second
$.hasClass 651768.1 Ops/sec
RegExp 2925296.8 Ops/sec
Dry RegExp 903595.2 Ops/sec
indexOf 3510743.0 Ops/sec
classList 2498391.2 Ops/sec
hasClassString 2212063.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • $.hasClass

  • RegExp

  • Dry RegExp

  • indexOf

  • classList

  • hasClassString