24 modern ES6 code snippets to solve practical JS problems

PHOTO EMBED

Fri Mar 05 2021 19:31:01 GMT+0000 (UTC)

Saved by @w_jellett

const hasClass = (el, className) => el.classList.contains(className);

// Example
hasClass(document.querySelector('p.special'), 'special'); // true
content_copyCOPY

https://madza.hashnode.dev/24-modern-es6-code-snippets-to-solve-practical-js-problems?guid