showing results for - "javascript count down with wile loop"
Mateo
01 Feb 2018
1//declare and instantiate your variable
2var timer = 60;
3
4//set up your loop that will run while your variable is greater than zero
5while (timer > 0) {
6//log timer to the console for debugging purposes
7console.log(timer);
8//reduce the count of timer by one over each iteration
9timer--;
10}
11
12//after timer has reached zero, the code will break out of the while loop and run the alert with your confirmation message
13alert("Done");
14