Microsoft® JScript®
JavaScript Reserved Keywords
 JScript Tutorial
Previous
Next


JavaScript has a number of reserved keywords. These words come in three types: JavaScript reserved keywords, future reserved words, and words to avoid.

JavaScript Keywords
breakfalseinthisvoid
continuefornewtruewhile
deletefunctionnulltypeofwith
elseifreturnvar 

 
JavaScript Future Keywords
casedebuggerexportsuper
catchdefaultextendsswitch
classdofinallythrow
constenumimporttry

The words to avoid are any that are already the names of intrinsic JavaScript objects or functions. Words like String or parseInt are included in this.

Using any of the keywords from the first two categories causes a compilation error when your script is first loaded. Using a reserved word from the third set can cause odd behavior problems if you attempt to use both your variable and the original entity of the same name in the same script. For example, the following script does not do quite what you think it should:

var String;
var text = new String("This is a string object");
In this case, you get an error saying that String is not an object. Many cases of using a pre-existing identifier aren't this obvious.

Home | Javascript validator | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.