You cannot use keywords, reserved words, true, false, and NULL as identifiers.
The keywords in JS can be used to denote the start or end of a control statement, or to perform a specific operation. By rule, keywords are also language-reserved and cannot be used as identifiers. Here are all the keywords for ecmascription:
Break, else, New, Var, case, finally, return, void, catch, for, switch, while, continue, function, this, with, DEFA Ult, if, throw, delete, in, try, do, instranceof, typeof
The ECMA also describes another set of reserved words that cannot be used as identifiers. Although reserved words do not have any specific purpose in this language, they are likely to be used as keywords in the future. The following are all reserved words defined by ECMA version 3rd:
abstract, enum, int, short, Boolean, export, interface, static, Byte, extends, long, super, Char, final, NA tive, synchronized, class, float, package, throws, const,Goto, Private, transient, debugger, implements, p rotected, volatile, double, import, public
Using keywords as identifiers in your code will be a "Identifier expected" (missing identifier) error in most browsers. Using reserved words may not cause the same error, depending on the browser. In general, it is best not to use keywords and reserved words as identifiers and to remain compatible with future versions of ECMAScript.
This digest is from "JAVASCRIPTI Senior Programmer Design (2nd edition)"
JS keywords and reserved words