A complete JavaScript implementation consists of the following three different parts: the core (ECMAScript), the Document Object Model (DOM), and the browser Object Model (BOM ). The ECMA-262 describes a group
A complete JavaScript implementation consists of the following three different parts: the core (ECMAScript), the Document Object Model (DOM), and the browser Object Model (BOM ). The ECMA-262 describes a set of keywords that have a specific purpose, which can be used to indicate the beginning or end of a control statement, or to execute a specific operation. According to the rules, keywords are reserved by language and cannot be used as identifiers. The following are all the keywords of ECMAScript (that is, Javascript) (the keywords added in version 5th with the * sign ):
Break |
Do |
Instanceof |
Typeof |
Case |
Else |
New |
Var |
Catch |
Finally |
Return |
Void |
Continue |
For |
Switch |
While |
Debugger * |
Function |
This |
With |
Default |
If |
Throw |
Delete |
In |
Try |
|
|
The ECMA-262 also describes another group of reserved words that cannot be used as identifiers. Although reserved words do not have any specific purpose in this language, they may be used as keywords in the future. The following are all reserved words defined by ECMA-262 version 3rd (reserved words added by version 5th with the * sign ):
Abstract |
Enum |
Int |
Short |
Boolean |
Export |
Interface |
Static |
Byte |
Extends |
Long |
Super |
Char |
Final |
Native |
Synchronized |
Class |
Float |
Package |
Throws |
Const |
Goto |
Private |
Transient |
Debugger |
Implements |
Protected |
Volatile |
Double |
Import |
Public |
Let * |
Yield * |
|
|
|
In addition to the keywords and reserved words listed above, ECMA-262 version 5th imposes limits on evel and arguments, and in strict mode neither can be used as an identifier or attribute name, otherwise an error is thrown.
The above are all the keywords and reserved words of Javascript. Whether it's a strict mode or not, whether it's for ECMA-262 3rd or 5th, to ensure maximum compatibility and code "security ", the keywords and reserved words mentioned above are not used as identifiers, attribute names, and function names during actual development.