关于javascript:js中关键字与保留字

关键字是在JavaScript曾经被规定为具备非凡性能的字。这些关键字可用于示意管制语句的开始或完结,或者用于执行特定操作等。依照规定,关键字也是语言保留的,不能用作标识符。ES2015新增let和const等为关键字。
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 let const
ECMA-262 还形容了另外一组不能用作标识符的保留字。只管保留字在这门语言中还没有任何特定的用处。但它们有可能在未来被用作关键字。以下是ECMA-262 第3 版定义的全副保留字:
abstract enum int short
boolean export interface static
byte extends long super
char final native synchronized
class float package throws
import goto private transient
debugger implements protected volatile
double public

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理