JavaScript authoritative guide-lexical structure

Source: Internet
Author: User
Tags control characters

Widely used, all browsers (desktop, mobile, screen, etc.) are equipped with the appropriate JavaScript parser.

Three skills: JavaScript, HTML, CSS.

JavaScript has long been beyond the scope of its "scripting language" itself and has become a programming language that combines robustness/efficiency and versatility.

The lexical structure of a programming language is a set of basic rules that describe how to use the language to write programs. As the basis of the syntax, it provides rules such as what the variable name is, how to write the comment, and how the program statements are split.

1. Character Set

JavaScript programs are written in the Unicode character set. Unicode is a superset of ASCII and Latin-l, and holds almost all the re-used languages on Earth. ECMAScript 3 requires that the implementation of JS must support Unicode2.1 and subsequent versions, and ECMASCRIPT5 requires support for UNIOCDE 3 and later versions.

Http://www.ruanyifeng.com/blog/2014/12/unicode.html

1.1. Case-sensitive

JS is a case-sensitive language. In other words, keywords, variables, function names, and all identifiers must be in a consistent case.

Note: HTML is case-insensitive, XHTML-differentiated.

For example, when you set an event handler in HTML, the OnClick property can be written as an onclick, but in the JS code or in an XHTML document, you must use the lower-case onclick.

1.2. Spaces, newline characters, format control characters

JS ignores spaces between the identities in the program. In most cases, JS also ignores line breaks. Because you can freely use spaces and line breaks in your code, you can make the code more readable by using neat, consistent indentation to form a unified coding style.

Characters in JavaScript that represent spaces: http://blog.csdn.net/sells2012/article/details/17509077

1.3.Unicode Escape Sequences

JavaScript authoritative guide-lexical structure

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.