how to close a setInterval in javascript code example
Example 1: stop a setinterval
let myVar = setInterval(() => {console.log('bop'), 1000);
clearInterval(myVar);
Example 2: stop window.setinterval javascript
window.clearTimeout(yourTimer)
let myVar = setInterval(() => {console.log('bop'), 1000);
clearInterval(myVar);
window.clearTimeout(yourTimer)