SoFunction
Updated on 2025-03-03

Keywords and reserved words sorting in Javascript

ECMA-262 describes a set of keywords with a specific purpose, which can be used to indicate the beginning or end of a control statement, or to perform a specific operation, etc. Regulations: Keywords are language reserved and cannot be used as identifiers.

All keywords for ECMAScript (* is added in the fifth edition):

breakdoinstanceoftypeofcaseelsenewvarcatchfinallyreturnvoidcontinueforswitchwhiledebugger*  functionthiswithdefaultifthrowdeleteintry

All reserved words in ECMA-262 (third edition):

abstractenumintshortbooleanexportinterfacestaticbyteextendslongsupercharfinalnativeclass

synchronizedfloatpackagethrowsconstgotoprivatetransientdebuggerimplementsprotectedvolatiledouble

importpublic

The reserved words may be used as a reprinted keyword, such as the new debugger added in the fifth edition is the reserved words in the third edition.

Reserved words in non-strict mode in the fifth edition:

classenumextendssupperconstexportimport

Reserve words in strict mode:

implementspackagepublicinterfaceprivatestaticletprotectedyield

Note: let and yield are newly added reserved words; for compatibility, it is recommended to be used as reference reserved words.

Using keywords and reserved words in Javascript will result in an error. Not recommended!