JavaScript lexical structure, javascript lexical

Source: Internet
Author: User

JavaScript lexical structure, javascript lexical

The lexical structure of a programming language is a set of basic rules used to describe how to use this language to write programs. As the basis of syntax, the basic lexical structure of JavaScript is as follows:

1. JavaScript programs are written in the Unicode Character Set. Unicode is a superset of ASCII and Latin-1 and supports almost all languages on the earth.

2. JavaScript is a case-sensitive language, while HTML is not case-sensitive.

3. JavaScript ignores spaces between identifiers in the program. In most cases, JavaScript also ignores line breaks.

4. JavaScript defines a special sequence that uses six ASCII characters to represent any 16-bit Unicode Internal code. These Unicode escape sequences are prefixed with \ u, followed by four hexadecimal numbers.

5. Unicode allows multiple methods to encode the same character. The Unicode Standard defines a preferred encoding format for all characters.

6. JavaScript supports comments in two formats: text after "//" at the end of a row, or text between "/*" and, all are ignored as comments. The latter can be written across lines but cannot contain nested comments.

7. JavaScript has a variety of Direct values, that is, the data values directly used in the program.

8. JavaScript identifiers must start with letters, underscores, or dollar signs. Subsequent characters can be letters, numbers, underscores, or dollar signs. Reserved Words in JavaScript cannot be used as common identifiers, sometimes valid keywords in common JavaScript code are not allowed in strict mode.

9. JavaScript statement delimiters are interesting. JavaScript uses semicolons to separate statements, but semicolons are optional. When JavaScript parses code, the semicolon is automatically filled only when a semicolon is missing and cannot be correctly parsed. If a statement starts with "(" or, sometimes a semicolon is added to the front of a statement to ensure that the statement is independent of the preceding statement.

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.