function setNormal() {
console.log(1)
}
function setAlert() {
console.log(2)
}
function alertFunction() {
alertVar = setInterval(alertFunc, 600);
}
function alertFunc() {
setAlert()
setTimeout(setNormal, 300)
}
alertFunction()
});
how do I make the function alertFunction() run only when (for example) var loop = 1 and then stop when var loop = 0?
(this is my first post to stackoverflow so sorry if I did this wrong)
ifstatement. To stop an interval, do a Google for "clear javascript interval".