DEV Community

Discussion on: 24 modern ES6 code snippets to solve practical JS problems

Collapse
3zzy profile image
Ibrahim Ezzy

hasClass(document.querySelector('p.special'), 'special'); doesn't make sense. If you're already searching with the class in selector, couldn't you just do if (document.querySelector('p.special')) ?