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() {

}

Answer

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


Source: stackoverflow