Reserved words in JavaScript

JavaScript FAQ | Basic Syntax & General Questions  

Question: What reserved words are there in JavaScript?

Answer: Reserved words of the JavaScript langauge are listed below. (Some of these words are actually used in the Java language, and are reserved in JavaScript for compatibility purposes or as possible extensions.) When choosing names for your JavaScript variables, avoid these reseved words!

In addition to the above reserved words, you'd better avoid the following identifiers as names of JavaScript variables. These are predefined names of implementation-dependent JavaScript objects, methods, or properties (and, arguably, some should have been reserved words):

Similarly, the following names (depending on your target browser) may have special meanings as event handlers, and therefore should not be used for any other purpose:


Copyright © 1999-2011,