关键字
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
保留字
ECMA-262 第3 版定义的全部保留字
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
第5 版把在非严格模式下运行时的保留字缩减为下列这些:
class enum extends super
const export import
在严格模式下,第5 版还对以下保留字施加了限制:
implements package public
interface private static
let protected yield
一般来说,最好不要使用关键字和保留字作为标识符和属性名
ECMA-262 第5 版对eval 和arguments 还施加了限制。在严
格模式下,这两个名字也不能作为标识符或属性名,否则会抛出错误。