JavaScript Keywords & Reserved Words
Every JavaScript keyword grouped by category with one-line descriptions. Master these and your fingers will keep up with your ideas.
Declarations
| Keyword | Description |
|---|---|
var | Function-scoped variable declaration (legacy) |
let | Block-scoped mutable variable |
const | Block-scoped immutable binding |
Control Flow
| Keyword | Description |
|---|---|
if | Conditional branch |
else | Fallback branch |
for | Count-based or iterator loop |
while | Condition-checked loop |
do | Execute body then check condition |
switch | Multi-case conditional |
case | Match arm inside switch |
break | Exit loop or switch |
continue | Skip to next loop iteration |
return | Return a value from a function |
default | Fallback case in switch |
Functions & Async
| Keyword | Description |
|---|---|
function | Declare a function |
async | Mark a function as asynchronous |
await | Wait for a Promise to resolve |
yield | Pause a generator and produce a value |
yield* | Delegate to another generator or iterable |
Classes & Objects
| Keyword | Description |
|---|---|
class | Define a class |
extends | Inherit from a parent class |
super | Reference the parent class constructor/methods |
new | Instantiate an object |
this | Reference the current object context |
static | Declare a static class member |
Modules
| Keyword | Description |
|---|---|
import | Import bindings from a module |
export | Export bindings from a module |
default | Default export of a module |
from | Specify the module source |
as | Alias an import or export |
Error Handling
| Keyword | Description |
|---|---|
try | Begin a guarded block |
catch | Handle a thrown exception |
finally | Always-run cleanup block |
throw | Throw an exception |
Operators & Types
| Keyword | Description |
|---|---|
typeof | Return type string of an operand |
instanceof | Check prototype chain membership |
void | Evaluate expression and return undefined |
delete | Remove a property from an object |
in | Check if property exists in object |
of | Iterate over iterable values (for...of) |
TypeScript Adds More
TypeScript extends JavaScript with additional keywords: type, interface, enum, namespace, readonly, abstract, declare, and more. Practice typing TypeScript below.
Practice typing these in CodeSpeedTest →
Knowing keywords is not the same as having them in your muscle memory. Start with Hello World and build up to real-world JS patterns.