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. Javascript has reserved these words for its own use. What are reserved keywords. This section contains a list of all keywords that are reserved in javascript. Ecmascript also defines certain keywords and literals and has rules for automatic insertion of semicolons to end statements.
Other reserved words javascript can be used as the programming language in many applications. Javascript has a number of reserved keywords. These are the words that you cannot use as identifiers variable names function names and loop labels in your javascript programs. Reserved words of the javascript langauge are listed below. This page describes javascript s lexical grammar.
For optimal backwards compatibility with older javascript engines it s best to avoid using the keywords on this page as variable names or property names even the old ecmascript 2 ones like char and default. Javascript keywords keywords are reserve words in javascript which you cannot use to name the variables labels or function names. Here are a total of 63 keywords which java script provides the programmers. Javascript reserved words avoid using reserved words and keywords as identifiers in your code. Reserved keywords may not be used as variable names in javascript.
The source text of ecmascript scripts gets scanned from left to right and is converted into a sequence of input elements which are tokens control characters line terminators comments or white space. The source text of ecmascript scripts gets scanned from left to right and is converted into a sequence of input elements which are tokens control characters line terminators comments or white space. For optimal backwards compatibility with older javascript engines it s best to avoid using the keywords on this page as variable names or property names even the old ecmascript 2 ones like char and default. Other reserved words javascript can be used as the programming language in many applications. 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.