JavaScript Learning Notes (i): lexical structure

Source: Internet
Author: User

One: Character set

JavaScript programs are written in the Unicode character set.

Two: case-sensitive

JavaScript is a case-sensitive language, but be aware that HTML is case-insensitive

Three: spaces, line breaks, and format controls

JavaScript ignores spaces between identities in the program

Four: Unicode escape sequences

In some computer hardware and software, cannot display or input Unicode character complete, in order to support those who use the old technology of programmers, JavaScript defines a special sequence, using 6 ASCII characters to represent any 16-bit Unicode inside code.

Five: Notes

are divided into two types:

Single-line Comment

/* * * Multi-line Comment

VI: Direct Volume

The direct amount is the value that is used directly in the program.

Seven: Identifiers and reserved words

An identifier is a name. In JavaScript, identifiers are used to name variables and functions, or to use tags that do jump positions in some of the loop statements in JavaScript code

Name of the identifier:

(1) must start with a letter, an underscore (_), or a dollar sign ($)

(2) Case-sensitive

(3) cannot start with a number

Reserved words: JavaScript takes some identifiers and uses them as their own keywords. As a result, it is no longer possible to use it as an identifier in the program.

Break Delete function return typeof case do if switch var etc.

JavaScript also retains some keywords that are not available in the current version, but may be used in future versions

Class Const export extends Import super

JavaScript pre-defines a number of global variables and functions and should avoid using their names as variable and function names.

Arguments encodeURI Infinity number REGEXP Array etc.

JavaScript Learning Notes (i): 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.