"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns9BDA75F38358eejj99@194.109.133.242...
> jacerhea wrote on 25 mrt 2009 in comp.lang.javascript:
>
>>> Why is this an easy question?
>>
>> Easier for some than others, I guess.
>
> I did not put the Q.
> The answer was easy.
> But why say the Q is easy?
> That does not make sense to me.
>
>> What about the semi-colon at the end?
>
> optional, unless you want two statements on one line/string
>
My original understanding was that the semicolon was a statement separator
which is not needed if statements are on separate lines. But I later read
(and came to understand) that semicolons are inserted by the browser where
needed. This was termed automatic semicolon insertion, or some phrase like
that.
So I thought that the correct syntax is to always use a semicolon, but if
you don't, then one will be inserted at the end of each line (where needed)
Am I way off course in this assessment?
--
Trevor Lawrence
Canberra
Web Site
http://trevorl.mvps.org