- Js program is encoded using Unicode character set;
- JS language is strictly case sensitive (variables, functions, keywords, identifiers)
- The JS language ignores whitespace wrapping tabs.
- JS statement to ; (semicolon) at the end, but if the statement is exclusive, the line can be omitted;
Note: not all line breaks can be omitted;
JavaScript fills;(semicolon only if a semicolon is missing and JavaScript does not parse the code correctly)
eg
As the above code JS in the parsing, because the JavaScript language is to ignore the space-wrapping tab, so he was in the execution of Var a place, no semicolon found, followed by the back, no semicolon found
and found the next line of a when JavaScript is not understood at this time, So the two sentences are separated by semicolons. It is because JS ignores the semicolon so it also leads to the following phenomenon:
This phenomenon, is obviously because the JS language itself on the whitespace wrapping, such as ignoring causes the previous line of code without a semicolon at the end of parsing the search down and the next row of the merge can be normal execution (there is write conservative programmer will precede the statement with a; eg: function () {}) (); )
total: a statement to " ( "," [ "," / "," + "," - Start, then he is most likely to parse with the previous merge
Exceptions: (two)
1). return | break | continue
2). "++ " | "-- "   No symbol is parsed with the next line of code, not the previous line (no semicolon on the previous line)
JavaScript authoritative Guide-language structure notes