- 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.
- The JS statement ends with a;(semicolon), but can be omitted if the statement is exclusive of a row;
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, so will be used in this two sentences; separated by semicolons. It is because JS ignores the semicolon so it also leads to the following phenomenon:
This phenomenon, obviously because the JS language itself on the white space line, such as ignoring causes the previous line of code without a semicolon at the end of the parsing when the search down and the next row of the merge can be normal execution (there is write conservative programmer will add one in front of the statement; Eg:; (function () {}) (); )
total: A statement with " ("," [","/"," + ","-"to begin, then he is most likely to parse with the previous merge
Exception: (both)
1). return | break | An expression after continue cannot wrap
2). "++" | "--" will not be parsed with the next line of code, not the previous line (no semicolon on the previous line)
JavaScript authoritative Guide-language structure notes