JavaScript中的保留字列表

5 javascript reserved-words

有没有比Mozilla更完整关于保留字的清单?

它缺少像parseFloat,toString,prototype等字样.

Mat*_*att 10

parseFloat,toString并且prototype保留字.仅仅因为它们有时具有特殊意义,并不意味着你不能用它们的名字来声明变量;

var prototype = "foo"; // no error.
Run Code Online (Sandbox Code Playgroud)

ES5标准中包含的保留字列表为好,但它应该匹配MDN给出的列表:

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

class, enum, extends, super, const, export, import
Run Code Online (Sandbox Code Playgroud)

您可能还会感兴趣的是,严格的ES5变量会在保留列表中添加其他单词;

标识符在严格模式代码中"implements", "interface", "let", "package", "private", "protected", "public", "static", and "yield"被分类为FutureReservedWord标记.(第7.6.1.2节).