JavaScript keywords and reserved words

Source: Internet
Author: User

You cannot use keywords, reserved words, true, false, and NULL as identifiers.

The keywords in JS can be used to denote the start or end of a control statement, or to perform a specific operation. By rule, keywords are also language-reserved and cannot be used as identifiers. Here are all the keywords for ecmascription (the 5th version of the New keyword with *):

Break, else, New, Var, case, finally, return, void, catch, for, switch, while, continue, function, this, with, DEFA Ult, if, throw, delete, in, try, do, instranceof, typeof, debugger*

The ECMA also describes another set of reserved words that cannot be used as identifiers. Although reserved words do not have any specific purpose in this language, they are likely to be used as keywords in the future. The following are all reserved words defined by ECMA version 3rd:

abstract, enum, int, short, Boolean, export, interface, static, Byte, extends, long, super, Char, final, NA tive, synchronized, class, float, package, throws, const, goto, private, transient, debugger, implements, Prote CTED, volatile, double, import, public

The 5th edition reduces the reserved words when running in non-strict mode to the following:

Class, Enum, extends, super, const, export, import

In strict mode, version 5th also imposes restrictions on the following reserved words:

Implements, package, public, interface, private, static, let, protected, yield

Note that let and yield are the new reserved words for the 5th edition, and the other reserved words are defined by the 3rd edition.

This digest is from "JAVASCRIPTI Senior Programmer Design (3rd edition)"

JavaScript keywords and reserved words

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.