element.classList.includes code example
Example 1: js check for class in classList
element.classList.contains(className);
Example 2: classList has class
if (document.body.classList.contains('thatClass')) {
// do some stuff
}
element.classList.contains(className);
if (document.body.classList.contains('thatClass')) {
// do some stuff
}