JavaScript reserved keywords are special words reserved by the language and cannot be used as variable, function, or class names. These words are part of the JavaScript specification and are kept reserved to support current features and future language updates.
What Are Reserved Keywords in JavaScript?
Reserved keywords are words that have a fixed meaning in JavaScript or are reserved for future use. Using them as identifiers will cause syntax errors or unexpected behavior.
Currently Used JavaScript Keywords (Reserved)
| Keyword | Category | Simple Meaning |
|---|
| break | Control Flow | Stops loop or switch |
| case | Control Flow | Matches case in switch |
| catch | Error Handling | Handles errors |
| class | OOP | Defines a class |
| const | Variable | Declares constant reference |
| continue | Loop Control | Skips current iteration |
| debugger | Debugging | Pauses execution |
| default | Control Flow | Runs when no case matches |
| delete | Operator | Deletes object property |
| do | Loop | Runs loop at least once |
| else | Control Flow | Runs when condition is false |
| export | Modules | Exports module |
| extends | OOP | Inherits class |
| finally | Error Handling | Always runs |
| for | Loop | Loop with counter |
| function | Functions | Declares function |
| if | Control Flow | Runs when condition is true |
| import | Modules | Imports module |
| in | Operator | Checks property in object |
| instanceof | Operator | Checks object type |
| let | Variable | Block-scoped variable |
| new | Objects | Creates new object |
| return | Functions | Returns value |
| super | OOP | Calls parent constructor |
| switch | Control Flow | Selects case |
| this | Objects | Refers to current object |
| throw | Error Handling | Throws error |
| try | Error Handling | Wraps risky code |
| typeof | Operator | Returns data type |
| var | Variable | Function-scoped variable |
| void | Operator | Returns undefined |
| while | Loop | Runs while condition is true |
| with | Deprecated | Avoid using |
| yield | Generators | Pauses generator |
Future Reserved Keywords (Cannot Be Used)
| Keyword |
|---|
| abstract |
| boolean |
| byte |
| char |
| double |
| final |
| float |
| goto |
| int |
| long |
| native |
| short |
| synchronized |
| throws |
| transient |
| volatile |
Strict Mode Reserved Keywords
| Keyword |
|---|
| implements |
| interface |
| package |
| private |
| protected |
| public |
| static |
Keywords That Look Like Values (Also Reserved)
| Keyword | Meaning |
|---|
| null | Represents no value |
| true | Boolean true |
| false | Boolean false |
Summary
JavaScript reserved keywords are protected by the language and cannot be used as identifiers. These keywords define core language features, control program flow, manage objects, handle errors, and support modules and asynchronous programming. Understanding reserved keywords helps avoid syntax errors and improves code readability and correctness.