Can someone please let me know where I went wrong here? When I run the code, I get 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10. How would I make the loop stop at 0? When I remove the last line of code (console.log(countDown);), the loop ends at 0 but the challenge isn't completed. Any help is greatly appreciated!
Using a for loop, decrement countDown by one each time the loop runs until it equals 0, making use of looping functionality instead of logging each number separately.
let countDown = 10;
// ADD CODE HERE
for (let countDown = 10; countDown>0;countDown--)
{
console.log(countDown);
}
// Uncomment the below line to check your work
console.log(countDown) // -> should print 0;