Tutorial by Examples

There are three basic rules of semicolon insertion: When, as the program is parsed from left to right, a token (called the offending token) is encountered that is not allowed by any production of the grammar, then a semicolon is automatically inserted before the offending token if one or more o...
empty statement var statement expression statement do-while statement continue statement break statement return statement throw statement Examples: When the end of the input stream of tokens is encountered and the parser is unable to parse the input token stream as a single complete Pro...
The JavaScript coding convention is to place the starting bracket of blocks on the same line of their declaration: if (...) { } function (a, b, ...) { } Instead of in the next line: if (...) { } function (a, b, ...) { } This has been adopted to avoid semicolon insertion ...

Page 1 of 1