A reserved word is an IdentifierName that cannot be used as an Identifier.
ReservedWord :: one of
await
break
case
catch
class
const
continue
debugger
default
delete
do
else
enum
export
extends
false
finally
for
function
if
import
in
instanceof
new
null
return
super
switch
this
throw
true
try
typeof
var
void
while
with
yield
NOTE 1 enum
is so far unused. It is reserved for use as a keyword in future language extensions.
NOTE 2 The ReservedWord definitions are specified as literal sequences of specific SourceCharacter elements. A code point in a ReservedWord cannot be expressed by a \
UnicodeEscapeSequence.
NOTE 3 In addition to the ReservedWord list, several early error rules constrain the set of IdentifierNames that can serve as Identifiers in a given context. See 12.1.1, 13.3.1.1, 13.7.5.1, and 14.6.1. These rules specify ECMAScript's conditional keywords, IdentifierNames that are sometimes reserved, depending on context. In summary:
-
Although
yield
andawait
are ReservedWords, they can serve as Identifiers in some contexts. -
Several names that are not in the ReservedWord list are nonetheless reserved in strict mode code:
let
,static
,implements
,interface
,package
,private
,protected
, andpublic
. -
The names
arguments
andeval
are subject to some restrictions in strict mode code. -
A few names appear in syntactic productions, but are not reserved at all, and thus can always be used as Identifiers:
as
,async
,from
,get
,of
,set
, andtarget
.