JavaScript’s reserved words
This page lists those words that are reserved by the JavaScript language for its use. The reserved words have a very specific meaning to JavaScript. Because these words are part of the language, you cannot use these words, for example, to name your variables or functions. This list is alphabetized for your convenience.
- abstract
- boolean
- break
- byte
- case catch
- char
- class
- comment
- const
- continue
- debugger
- default
- delete
- do
- double
- else
- enum
- export
- extends
- false
- final
- finally
- float
- for
- function
- goto
- if
- implements
- import
- in
- instanceof
- int
- interface
- label
- long
- native
- new
- null
- package
- private
- protected
- public
- return
- short
- static
- super
- switch
- synchronized
- his
- throw
- throws
- transient
- true
- try
- typeof
- var
- void
- volatile
- while
- with
Here’s a complete table of JavaScript’s reserved words, categorized by their purpose (keywords, future reserved words, and literals):
JavaScript Reserved Words (Keywords)
Category | Reserved Words |
---|---|
Value Keywords | true , false , null |
Declaration | var , let , const , function , class |
Control Flow | if , else , switch , case , default , for , while , do , break , continue , return |
Error Handling | try , catch , finally , throw |
Object-Oriented | new , this , super , extends , instanceof , typeof , delete , in , with |
Async/Await | async , await , yield |
Strict Mode | implements , interface , package , private , protected , public , static |
Future Reserved Words
(Not currently used but reserved for future versions of JavaScript)
| enum
| export
| import
| await
(in modules) |
| abstract
| boolean
| byte
| char
|
| double
| final
| float
| goto
|
| int
| long
| native
| short
|
| synchronized
| throws
| transient
| volatile
|
Avoid Using These as Identifiers!
These words cannot be used as variable names, function names, or labels.
Examples of Invalid Usage:
let class = "SyntaxError"; // ❌ Error!
const enum = { value: 1 }; // ❌ Error!
function throw() { } // ❌ Error!
Full Alphabetical List
For quick reference, here’s an A-Z list of all reserved words:
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
Key Notes:
- Strict Mode Adds More Restrictions:
arguments
,eval
cannot be reassigned.implements
,interface
, etc., are reserved in strict mode.
- Module-Specific Reserved Words:
await
is only reserved in module contexts.
- Avoid Conflicts:
- Even if some words (like
let
) are newer, older browsers may treat them as invalid.
- Even if some words (like