3 ms·
The browser somehow detects that the missing semicolon wasn't omitted and doesn't add it???
by tedunangst 9y ago
The browser somehow detects that the missing semicolon wasn't omitted and doesn't add it???
- cerved 9y agoNo. If it's missing it's inserted obviously. That's why you shouldn't omit it. Here are the rules for parsing if you're interested When the program contains a token that is not allowed by the formal grammar, then a semicolon is inserted if (a) there is a line break at that point, or (b) the unexpected token was a closing brace. When the end of a file is reached, if the program cannot be parsed otherwise, then a semicolon is inserted. When a "restricted production" is encountered and contains a line terminator in a place where the grammar contains the annotation "[no LineTerminator here]", then a semicolon is inserted.