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.