JavaScript Programs are written using the Unicode character set. Unicode is a superset of ASCII and Latin-1 and supports almost every language in use on the planet. ECMAScript3 requires that JavaScript implementations must support Unicode2.1 and subsequent versions, and ECMAScript5 requires support of Unicode3 and subsequent versions.
JavaScript is a case-sensitive language, that is, keywords, variables, functions Names and all identifiers must be in consistent case. However, it is important to note that HTML is not case-sensitive (although XHTML is case-sensitive).
JavaScript will ignore spaces between tokens in the program, and in most cases will also ignore newlines.
Because spaces and line breaks can be used freely in the code, neat and consistent indentation can be used to implement a unified coding style, thereby improving the readability of the code.
Space characters recognized by JavaScript:
Normal space characters\u0020
The carriage return and line feed characters together are parsed into a single line terminator
regular expressions in formula and identifiers (except keywords).
The above is the detailed content of Detailed explanation of character sets in JavaScript. For more information, please follow other related articles on the PHP Chinese website!