Practicing counting down problem


#1

So I this so far:

for (var i = 10; i >= 1; i++) {
console.log(i);
}

Codeacademy says the answer is supposed to be 10..0 but it keeps crashing for me, I probably ran an infinite loop but I don't know where I went wrong.

Here were the instructions

Instructions
Change this code such that it starts counting from 10.
We want it to stop once it gets to 0.
We want it to count down by 1.
In the end, the numbers 10..0 inclusive, should be printed.

And the code started like this
for (var i = 1; i >= 1; i++) {
console.log(i);
}


#2

Haha, that made me laugh a bit. The reason your code didnt work is since it was incrementing. Your suppose to decrement it , and that its suppose to end at 0 not 1 as your code did. Here is a documentation about that. Anyways if you still dont understand this is what you did wrong:

Your Code:

Correct Code:

for (var i = 10; i >=0; i++)

If you still have Issues, Please reply to me as i will do my Best to help you out. Thanks!


#3

Well spotted it is about decrementing so it needs to be:

for (var i = 10; i >=0; i--) // -- not ++

#4

Thanks for your help!