JavaScript Keywords | List of Reserved Words
Keywords in JavaScript are pre-defined words that have specific meanings to the interpreter and that meanings cannot be changed. They are also called reserved words in JavaScript.
JavaScript provides a set of reserved keywords that are the part of syntax in the JavaScript language.
JavaScript’s keywords are used to perform actions in the program. For example, the let keyword tells the browser to create a variable:
let x = 10;
Here, let is a keyword that indicates that x is the name of a variable that stores a value 10. Since keywords have specific meaning in JavaScript language, we cannot use them to define variables, functions, or labels that have the same names as these keywords. For example:
let const = 20; // Invalid
Here, const cannot be a variable name because const is a keyword that is used to store a constant value.
Since JavaScript is a case-sensitive language, all keywords in JavaScript must be written in lowercase letters (small letters).
List of JavaScript Keywords (Reserved Words)
Table shows the list of commonly used total number of keywords (reserved words) in the JavaScript language. They are as follows:
| 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 | var | void |
| volatile | while | with | yield |
Note: Reserved words marked with* are new in ECMAScript 5 and 6.
Removed Reserved Words
The following JavaScript keywords have been removed from the ECMAScript 5/6 standard:
| abstract | boolean | byte | char | double | final |
| float | goto | int | long | native | short |
| synchronized | throws | transient | volatile |
Note: Do not use these removed reserved words to define the name of variables. ECMAScript 5/6 does not have full support in all web browsers.
JavaScript Objects, Properties, and Methods
You should also abstain for using the name of pre-defined JavaScript objects, properties, and methods:
| Array | Date | eval | function | hasOwnProperty | Infinity |
| isFinite | isNaN | isPrototypeOf | length | Math | NaN |
| name | Number | Object | prototype | String | toString |
| undefined | valueOf |
In this tutorial, we have listed of all JavaScript keywords (reserved words) that should not be used as variables, functions, or labels names. We hope you will have understood all the basic points related to JavaScript reserved words.







