JavaScript keywords are reserved words used by the language to define syntax and control program behavior. These words cannot be used as variable, function, or class names.
Core JavaScript Keywords
| Keyword | Category | Simple Meaning |
|---|---|---|
| var | Variable | Declares a function-scoped variable |
| let | Variable | Declares a block-scoped variable |
| const | Variable | Declares a constant reference |
| if | Control Flow | Runs code when condition is true |
| else | Control Flow | Runs code when condition is false |
| switch | Control Flow | Selects code based on value |
| case | Control Flow | Matches a case in switch |
| default | Control Flow | Runs when no case matches |
| for | Loop | Loop with counter |
| while | Loop | Runs while condition is true |
| do | Loop | Runs loop at least once |
| break | Loop Control | Stops loop or switch |
| continue | Loop Control | Skips current iteration |
| function | Functions | Declares a function |
| return | Functions | Sends value back from function |
Object-Oriented Programming Keywords
| Keyword | Category | Simple Meaning |
|---|---|---|
| class | OOP | Defines a class |
| extends | OOP | Inherits another class |
| constructor | OOP | Initializes class |
| super | OOP | Calls parent constructor |
| new | Objects | Creates new object |
| this | Objects | Refers to current object |
Error Handling Keywords
| Keyword | Category | Simple Meaning |
|---|---|---|
| try | Error Handling | Wraps risky code |
| catch | Error Handling | Handles errors |
| finally | Error Handling | Always runs |
| throw | Error Handling | Throws custom error |
Operators and Type Checking Keywords
| Keyword | Category | Simple Meaning |
|---|---|---|
| typeof | Operator | Returns data type |
| instanceof | Operator | Checks object type |
| in | Operator | Checks property in object |
| delete | Operator | Deletes object property |
Modules and Async Keywords
| Keyword | Category | Simple Meaning |
|---|---|---|
| import | Modules | Imports module |
| export | Modules | Exports module |
| async | Async | Declares async function |
| await | Async | Waits for promise |
| yield | Generators | Pauses generator |
Reserved Keywords (Do Not Use as Identifiers)
| Reserved Words |
|---|
| abstract, boolean, byte, char, double, final, float, goto, int, long, native, short, synchronized, throws, transient, volatile |
Deprecated / Special Keywords
| Keyword | Status | Meaning |
|---|---|---|
| with | Deprecated | Extends scope chain |
| debugger | Debugging | Pauses execution in dev tools |
Summary Table
| Purpose | Keywords |
|---|---|
| Variables | var, let, const |
| Conditions | if, else, switch, case, default |
| Loops | for, while, do, break, continue |
| Functions | function, return |
| OOP | class, extends, constructor, super, this, new |
| Errors | try, catch, finally, throw |
| Modules | import, export |
| Async | async, await, yield |
| Operators | typeof, instanceof, in, delete |