Learn the second chapter of the JavaScript authoritative guide

Source: Internet
Author: User

1. JavaScript is case sensitive, but HTML is not case sensitive

2, JS will ignore the space between the logo, in most cases will also ignore the newline character, so to use

Neat, Consistent coding style

3,//As the end of the comment,/* and/* can be used as a cross-line comment, but cannot have nested note

Release

4. The identifier must start with a letter, underscore, or dollar sign (the number is not allowed as the first word

character), subsequent characters can include the number

For convenience, we generally use ASCII letters and numbers to denote

5, for the semicolon ";" If a statement is an exclusive line, you can not add a semicolon after the

Note: It is not necessary to add a semicolon to each line, and JS fills the semicolon only if the code is missing a semicolon and cannot be parsed correctly.

At some point, you must manually add a semicolon, such as:

For the sake of conservatism, you can also add a semicolon in front of the statement so that if the semicolon of the previous sentence is deleted by mistake, it can be parsed correctly.

6, * if it involves a return, break, continue statement in the scene, if the three keywords followed by a newline, JS will fill the semicolon at the line.

* When it comes to the "+ +" and "--" operators, if they are prefixed, they should be on the same line as the expression, or the end of the line will fill the semicolon

Learn the second chapter of the JavaScript authoritative guide

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.