I was having a look at some code a friend did and stumbled across this line which I thought was an error (simplified for example)..
for (g = 0; 10 > g; g+
As far as I know this is simply a syntax feature of the language. Basically, javascript ignores that semicolon.
EDIT: Sorry, misread your post. If you mean that you only get alerted once, then you have basically an empty loop executing ten times, then a single block of code containing the alert executing once.
Accolades ({...}) can go around any block of code, independent of constructs such as for-loops.