Introduction to For Loops - Practice Counting Down



I keep finding that on this exercise my browser just crashes when I click save and submit. I've tried more than one browser on my laptop. The browsers are fine in all other web sites and online tasks, so I don't think it's an issue with my laptop.

Please see my code below and advise on what could be causing this issue.

Thank you :confused:

// Example of infinite loop. THIS WILL CRASH YOUR
// BROWSER. Don't run the code without changing it!

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


you have an infinity loop, i++ is a shorthand for i = i + 1

if you want to get from higher to lower value, increasing by one is not a good idea


Thank you for your prompt response.

The lesson does not make that aspect clear, should I increase by 2 or more then?


if you want to get from higher to lower number, i wouldn't increase at all.


Ah, so then you would decrease instead?


I just changed my code as follows and it worked!! :joy:

for (var i = 10; i >= 0; i-=1) {