let canExit = false;
setTimeout(function() {
canExit = true;
}, 1000);
function recc() {
if (canExit) {
console.log("Bye bye…");
} else {
console.log("always else…");
recc();
}
}
recc();
I think I get it, let me know if my understanding is wrong!