34,333
edits
Changes
→JavaScript ''for'' loops
The syntax of a for loop is as follows:
<pre>
for ( ''initializer''; ''conditional expression''; ''loop expression'' )
{
statements to be executed
}
</pre>
The ''initializer'' typically initializes a counter variable. Traditionally the variable ''i'' is used for this purpose. For example: