JavaScript Reserved Keywords Cheatsheet
Let's look at all reserved keywords in JavaScript.
Join the DZone community and get the full member experience.
Join For FreeWhen writing code, a reserved keyword is one you can't use as the name of a variable or identifier. As of 2022, this is the full list of valid reserved keywords in JavaScript.
All JavaScript Reserved Keywords
The below list cannot be used as variable names, as they are reserved keywords. Most of them have current functionality in JavaScript. Some do not, but they are words that may have some sort of functionality in the future. Avoid using these words in variable names.
- await
- break
- case
- catch
- class
- const
- continue
- debugger
- default
- delete
- do
- else
- enum
- export
- extends
- false
- finally
- for
- function
- if
- import
- in
- instanceof
- new
- null
- return
- super
- switch
- this
- throw
- true
- try
- typeof
- var
- void
- while
- with
- yield
Published at DZone with permission of Johnny Simpson, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments