Reserved words (keywords+) in JavaScript
npm package: https://www.npmjs.com/package/reserved-words
code I've prepared:
// *All* known reserved words in JavaScript (ES5, ES6)
// - includes older keywords from earlier ES versions
// - includes 'unofficial' keywords such as NaN, Infinity.
//
// references:
// - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar
// - https://mathiasbynens.be/notes/reserved-keywords
const RESERVED_WORDS =
[
"Infinity",
"NaN",
"abstract",
"arguments",
"await",
"boolean",
"break",
"byte",
"case",
"catch",
"char",
"class",
"const",
"continue",
"debugger",
"default",
"delete",
"do",
"double",
"else",
"enum",
"eval",
"export",
"extends",
"false",
"final",
"finally",
"float",
"for",
"function",
"goto",
"if",
"implements",
"import",
"in",
"instanceof",
"int",
"interface",
"let",
"long",
"native",
"new",
"null",
"package",
"private",
"protected",
"public",
"return",
"short",
"static",
"super",
"switch",
"synchronized",
"this",
"throw",
"throws",
"transient",
"true",
"try",
"typeof",
"undefined",
"var",
"void",
"volatile",
"while",
"with",
"yield"
];
npm package: https://www.npmjs.com/package/reserved-words
code I've prepared:
// *All* known reserved words in JavaScript (ES5, ES6)
// - includes older keywords from earlier ES versions
// - includes 'unofficial' keywords such as NaN, Infinity.
//
// references:
// - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar
// - https://mathiasbynens.be/notes/reserved-keywords
const RESERVED_WORDS =
[
"Infinity",
"NaN",
"abstract",
"arguments",
"await",
"boolean",
"break",
"byte",
"case",
"catch",
"char",
"class",
"const",
"continue",
"debugger",
"default",
"delete",
"do",
"double",
"else",
"enum",
"eval",
"export",
"extends",
"false",
"final",
"finally",
"float",
"for",
"function",
"goto",
"if",
"implements",
"import",
"in",
"instanceof",
"int",
"interface",
"let",
"long",
"native",
"new",
"null",
"package",
"private",
"protected",
"public",
"return",
"short",
"static",
"super",
"switch",
"synchronized",
"this",
"throw",
"throws",
"transient",
"true",
"try",
"typeof",
"undefined",
"var",
"void",
"volatile",
"while",
"with",
"yield"
];
Comments
Post a Comment