I faced this issue when trying to manipulate DOM.
let count = 0;
const counter = document.getElementById('value');
const btns = document.querySelectorAll('.btn');
btns.forEach(btn =>{
btn.addEventListener('click', handleClick)
})
function handleClick(event){
const classList = event.currentTarget.classList;
if(classList.contains('decrease')){ count--;}
else if(classList.contains('increase')){ count++;}
else {count=0}
if(count>0){ counter.style.color="green";}
else if(count<0){ counter.style.color="red";}
else {counter.style.color="#222";}
counter.textContent=count;
}
On the place on contains when I was trying to use includes then it is showing error.