One of the things JSLint will often point out is the lack of spacing around your operators. In addition to proper spacing around the operators, JSLint also requires a space between the closing parenthesis and the opening curly brace.
My guess is that using an increment operator in a harmless for loop is not going to cause much of a problem for you. But who am I to question? So what is the alternative?
Now there are no significant errors in this seemingly harmless bit of code. In a large application, and with large values and multiple loops, this can contribute to performance issues.
Of course, you might have a case where decrementing your loop would not work, so this is just something to consider should the situation allow for it. And by all means, do the necessary research before you take my word as gold.Let’s take a look at a practical example of this.
The condition is checked every time at the beginning of the loop. I'm trying to loop through the rows returned from the php, and put each row as a row in the table of my html.. I get the correct response from the php, but my loop doesn't show anything in .
Note: In the demo you might notice that the size of the canvas has been set in both the CSS and via width and height.