JavaScript keywords are the words with a fixed meaning in the language’s grammar, such as if, class, await, and typeof. Most of them are reserved words, so code can’t use them as variable or function names. Others are contextual keywords like of, get, and async, which act as keywords only in certain positions and work as ordinary identifiers everywhere else.
A few, including let, static, and implements, are reserved only in strict mode. The JavaScript Keywords area gives each one a short entry with its syntax, an example you can run in a JavaScript console, and its common uses.
The list follows the ECMAScript specification and grows only when a new feature reaches Stage 4 at TC39, as using and await using did for explicit resource management. The meta-properties new.target and import.meta are covered in the new and import entries. Names like undefined, NaN, and Infinity look like keywords, but they’re properties of the global object, so they’re covered in other areas.
Topics covered include:
Declarations and scope: Binding and declaration syntax (var, let, const, using)
Classes and objects: Class syntax and object references (extends, super, this, new)
Control flow: Conditionals, loops, and jumps (if, switch, for, break)
Async and generators: Function suspension and resumption (async, await, yield)
Modules: Code sharing between files (import, export, from, as)
Keyword operators: Operators spelled as words (typeof, instanceof, delete, void)
Literals: Boolean values written directly in code (true, false)
Other reserved words: Debugging syntax, legacy statements, and reserved identifiers (debugger, with, enum)
Concepts that keywords rely on, such as closures, hoisting, and the temporal dead zone, are explained in the JavaScript Glossary. The types that values belong to, such as boolean and undefined, have their own entries in JavaScript Primitive Types, and so does null, literal included. Objects like Promise and Array live in Standard Built-in Objects. This area sticks to the words themselves, what each one does, and where the grammar allows it.
Not sure which term you need? Describe what you’re trying to do, and Mentor AI will point you to the right entries.
asA contextual keyword that renames bindings in import and export clauses and names the namespace object in import as and export as.
asyncA contextual keyword that defines an async function, which always returns a promise and can pause at await expressions.
awaitA keyword that pauses an async function or module until a promise settles, then returns its fulfillment value or throws its rejection reason.
await usingDeclares a block-scoped constant whose value is disposed of asynchronously when the enclosing scope exits.
breakEnds the innermost loop or switch statement right away, or with a label, exits the labeled statement that contains it.
caseStarts a clause in a switch statement that runs when its value is strictly equal to the switch expression, then falls through until a break.
catchStarts the clause of a try statement that runs when the try block throws, with an optional binding for the thrown value.
classDefines a class, a constructor function whose body declares its methods, fields, and accessors, as a block-scoped declaration or an expression.
constDeclares a block-scoped binding that must be initialized and can’t be reassigned, though the value it holds can still change.
continueSkips the rest of the current loop pass and moves on to the next one, or with a label, to the next pass of an outer loop.
debuggerA statement that pauses execution like a breakpoint when a debugger is attached, and has no effect otherwise.
defaultA keyword that marks the fallback clause of a switch statement and the main export of a module.
deleteAn operator keyword that removes a property from an object and returns true, or false when the property can’t be removed.
doStarts a do…while loop, which runs its body once and then repeats it for as long as the condition after the body is truthy.
elseStarts the optional branch that an if statement runs when its condition is falsy, and chains further tests with else if.
enumA reserved word that JavaScript sets aside for future use without giving it a meaning, so it can’t name a variable or function.
exportA keyword that makes a module’s functions, classes, and values available to other modules through named exports, a default export, or re-exports.
extendsMakes a class inherit from another class or constructor, linking their prototype chains so instances and the class share the parent’s members.
falseA reserved word and Boolean literal for the logical value false, one of the two values of the boolean type.
finallyStarts the clause of a try statement that always runs when control leaves the try and catch blocks, whether or not an error was thrown.
forStarts a loop that runs an initializer once, then repeats its body while a condition holds, running an update after each pass.
fromA contextual keyword that names the source module in import declarations and in export statements that re-export another module’s bindings.
functionDefines a function as a hoisted declaration or as an expression, and with an asterisk as a generator function.
getA contextual keyword that defines a getter, a function that runs when code reads a property of an object or class.
ifStarts a conditional statement that runs its body only when a condition is truthy, with an optional else clause for the other case.
importA keyword that brings bindings exported by another module into scope, or loads a module on demand with the dynamic import() syntax.
inAn operator that checks whether an object has a property, own or inherited, and the keyword that separates the variable from the object in a for…in loop.
instanceofAn operator keyword that checks whether a constructor’s prototype appears in an object’s prototype chain and returns true or false.
letDeclares a block-scoped variable that can be reassigned, and that can’t be read before its declaration runs.
newAn operator keyword that calls a constructor, such as a class, to create a new object linked to the constructor’s prototype.
ofA contextual keyword that separates the loop variable from the iterable in for…of and for await…of loops.
returnEnds a function call and sends a value back to the caller, or undefined when no value follows the keyword.
setA contextual keyword that defines a setter, a function that runs when a property is assigned, in classes and object literals.
staticDeclares a class member that belongs to the class itself, such as a static method, field, or initialization block, rather than to its instances.
superCalls a parent class constructor or reads a property from the parent prototype inside a class or object method.
switchStarts a statement that compares one value against case clauses with strict equality and runs code from the first match.
thisA keyword that refers to the object a function was called on, or to another value set by how and where the code runs.
throwThrows an exception that stops the current code and passes the thrown value to the nearest enclosing catch clause.
trueA reserved word and Boolean literal for the logical value true, one of the two values of the boolean type.
tryStarts a statement that runs a block of code and handles exceptions it throws with a catch clause, a finally clause, or both.
typeofAn operator keyword that returns a string naming the type of its operand, such as “number”, “string”, “object”, or “function”.
usingDeclares a block-scoped constant whose value is disposed of automatically through its Symbol.dispose method when the scope exits.
varDeclares a function-scoped variable that’s hoisted and set to undefined before its declaration runs, and that can be redeclared.
voidAn operator that evaluates an expression and returns undefined, used to discard values in arrow functions and IIFEs.
whileStarts a loop that checks a condition before each pass and repeats its body for as long as the condition is truthy.
withStarts the legacy with statement, forbidden in strict mode, and introduces import attributes such as type json in import declarations.
yieldA keyword that pauses a generator function and hands a value to the caller, resuming when the generator’s next() method runs again.
Get a JavaScript Cheat Sheet (PDF), a printable reference to variables, types, strings, arrays, objects, functions, classes, modules, and async basics: