Skip to content
Advertisement

Reset variable when variable is 0 [closed]

I have a countdown that goes from 100 to 0. When it reaches 0, I want it to be restarted. How can I do this?

if(sec = 0) {
    sec=100
}
else() {

}

Advertisement

Answer

if(sec == 0) { sec=100; }
else { sec--; }
6 People found this is helpful
Advertisement