Exercise:
Declare a variable named countdown and assign it the value of 10. In a while loop, decrement the value of countdown once for every iteration and print it. Once countdown hits 0, print 'Blastoff' to the console.
What I've done so far:
var countdown = 10;{
while (countdown > 0 || 0=== "Blastoff!"){
console.log(countdown);
countdown = countdown - 1;
}
console.log("Blastoff!");
}
This is the result until now that i thought it should be correct:
Output
>>>>Code is incorrect
The first line in your while's block should decrement the value of the variable countdown
10
9
8
7
6
5
4
3
2
1
Blastoff!