Why does the browser crash?


#1

Why does the browser crash when the wrong syntax is inputted such as
for (var i = 0; i <=100; i-=5) {
console.log(i);
}

??


#2

The syntax is fine. But it has your browser really busy executing an infinite loop.


#3

He means that you should look at how your for loop is decrement instead of an increment, that's a little hard to see. Good catch @ionatan, I didn't see that until after I read your post.


#4

Hey @singha22! Your loop is basically decrementing not incrementing. So it will never be greater than 100.

So instead of this:

Do this:
for (var i = 0; i <=100; i+=5) {