I start the cycle, the condition is repeated, checking the value I need, but when I get the answer true, the cycle is not reset, it gives the error "ReferenceError: timer is not defined", why? How can I solve this problem?
function sboot() ( if(условие) { clearInterval(timer); }; ); //условия для повторения function sfinboot() {var timer = setInterval(sboot, 2000);}; //функция цикла sfinboot() //запуск