Why am I getting this error even after my code works

I was learning while loop in JS and when I excited the code I got the error in the image. Isn’t this the way for incriminating a variable? Or is it my compiler (Brackets) ?. But my loop ran . I just want to know the reason behind the error.

That’s not a JavaScript error. That’s JSLint. Whatever lint rules you’re using enforce avoiding increment and decrement operators.

See this StackOverflow for why that’s a lint rule and/or how to change the rule.

1 Like