JavaScript authoritative Guide-language structure notes

Source: Internet
Author: User

    • 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.