JavaScript authoritative Guide chapter II lexical structure

Source: Internet
Author: User

This chapter is mainly about the words of the reservation

JavaScript takes some identifiers for its own keywords. Therefore, these keywords can no longer be used as identifiers in the program:

Break Delete function return typeof

Case do if switch var

Catch else in this void

Continue false instanceof Throw while

Debugger finally new true with

Default for NULL try

JavaScript also retains some keywords, which are not used in the current language version, but may be used in future versions. ECMAScript 5 retains these keywords:

Class Const Enum export extends import super

In addition, the following keywords are valid in normal JavaScript code, but are reserved words in strict mode:

Implements let private public yield

Interface Package protected Static

Strict mode also restricts the use of the following identifiers, which are not entirely reserved words, but cannot be used as variable names, function names, or parameter names:

Arguments eval

ECMAScript 3 Lists all of Java's keywords as their own reserved words, although these reserved words are relaxed in ECMAScript 5, but if you want code to run on an interpreter based on the ECMAScript 3 implementation, you should avoid using these keywords as identifiers:

Abstract double goto native static

Boolean Enum implements package Super

Byte Export Import private synchronized

char extends int protected throws

Class final interface public transient

Const float Long Short volatile

JavaScript pre-defines a number of global variables and functions and should avoid having their names used as variables and function names:

Arguments encodeURI Infinity number REGEXP

Array encodeuricomponent isfinite Object String

Boolean Error IsNaN parsefloat syntaxerror

Date eval JSON parseint TypeError

decodeURI evalerror Math rangeerror undefined

decodeURIComponent Function NaN referenceerror urierror

It is important to keep in mind that JavaScript implementations may define unique global variables and functions, and each specific JavaScript runtime environment (client, server, etc.) has its own list of global properties.

JavaScript authoritative Guide chapter II 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.