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--; }
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() { }
if(sec == 0) { sec=100; } else { sec--; }