关键字
- 如果使用关键字 name 声明一个值,只能是 string 类型!!!
关键字、保留字分类
操作符关键字
instanceoftypeofdelete
类型关键字
语法关键字
breakdocaseelsenewcatchfinallyreturncontinueforswitchwhiledebugger *thiswith设置特定对象中的作用域intry
jsconst s = 'Hello'; with (s) { console.log(length); } // with 语句是运行缓慢的代码块,尤其是在已设置了属性值时。大多数情况下,如果可能,最好避免使用它。defaultifthrow
声明关键字
functionvoidvar
算术操作符
ECMA-262 保留字
abstractenumintshortbooleanexportinterfacestaticbyteextendslongsupercharfinalnativesynchronizedclassfloatpackagethrowsconstgotoprivatetransientdebuggerimplementsprotectedvolatiledoubleimportpublic
第五版非严格模式下缩减为
classenumextendssuperconstexportimport
严格模式下,保留字限制
implementspackagepublicinterfaceprivatestaticletprotectedyield