The clearInterval() method is not working after execution of the function body. here's the code snippet:
const clearAll = () =>{
const del = setTimeout(() => Display.textContent = 'deleted',100);
clearTimeout(del)
}
clearBtn.addEventListener("click", clearAll)
It seems you delete the timeout before it happens at least once. Try calling clearTimeout after it executes.
const clearAll = () => {
const del = setTimeout(() => {
Display.textContent = 'deleted';
clearTimeout(del);
}, 100);
};
clearBtn.addEventListener("click", clearAll);