for
loops can have anything between 0 and three statements in their header:
Endless loop:
for(){}
Loop with initialization:
for($n=0){}
Loop with initialization and end condition:
for($n=0;$n-lt7){}
In such cases the additional semicolons at the end may be omitted (something that isn't pointed outit's explicitly stated in any published grammar of the language, sadlylanguage specification, but helpful for golfing nonethelessso it's not an implementation detail) in contrast to C-like languages which always require exactly three statements.
This also makes while
a bit shorter. Compare
while(...){}
and
for(;...){}
With the added bonus that you can stick in a previous line (if there is one) into the for
as well without extra cost (and even saving a character).