How to make continue loop after certain condition meet?I mean need to restart loop again after certain condition value or range meet .
Jquery setinterval loop condition restart after certain condition meet but below my code not working even not restart.
//Global interval:any;
<i>public autoCheckPagination(): void {
clearInterval(this.interval);
this.interval=setInterval(function(){
if(pageCount<3){ //loop range till 3
if(count<1){
count=5;
pageNextClick.click();
}
document.getElementById("displayAutoCount").innerHTML = count+"";
count--;
pageCount++;
}else if(pageCount==3){ //loop meet condition again but not restart
restart loop again
pageCount=1;
clearInterval(this.interval);
this.running=true;
}
},1000);
}</i>
Setinterval loop not restart again if condition meet .