Is it possible to stop an infinite loop from running at all?
Right now I am doing something like this:
var run = true;
loop ({
if(run) {
whatever
}
}, 30),
Then when I want to stop it I change run to false, and to true when I want to start it again.
But the loop is always running whatever I do. It just not executing the code inside.
Is there a way to stop it completely? and make it start again when I want?
loopa function?forandwhilewithbreak,setTimeoutwith flag,setIntervalwithclearInterval.