2nd Chapter Lexical Structure

Source: Internet
Author: User

1. JavaScript programs are written in the Unicode character set. So the variable name can be Chinese.

2. JavaScript is a case-sensitive programming language. But HTML is not case-sensitive. Because HTML and client-side JavaScript are closely linked, this is easily confusing.

For example, when you set an event handler in HTML, the OnClick property can be written as an onclick, but you must use the lowercase onclick in JavaScript.

3. JavaScript ignores the spaces between tokens in the program and, in most cases, ignores line breaks. Because you can freely use spaces and line breaks in your code, you can adopt a neat, consistent indentation of the unified coding style.

4. For Unicode characters that cannot be displayed with the keyboard, JavaScript defines a Unicode escape sequence to represent Unicode characters: \uxxxx.

5. JavaScript is annotated in the same way as C, \ \ or/**/.

6. JavaScript identifiers are used to name variables or functions, starting with letters, underscores (_), or dollar ($) characters, followed by letters, numbers, underscores, or dollar symbols. Although JS allows any character in the Unicode character set to be used in an identifier, it is usually used only in ASCII letters for portability and easy writing purposes.

7. A semicolon that separates different statements in JavaScript is optional.

2nd Chapter Lexical Structure

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.