Javascript
Reserved Keyword In Javascript?
Javascript has a Predefined Collection of reserved keywords that can not be used as variables Name, Labels or Function, and Class Name.
ECMA Script: 1
- break
- catch
- case
- class
- const
- continue
- debugger
- default
- delete
- do
- else
- enum
- export
- extends
- false
- finally
- for
- function
- if
- import
- in
- new
- null
- return
- super
- switch
- this
- throw
- true
- try
- typeof
- var
- void
- while
- with
ECMA Script: 2
Add 24 additional reserved keywords in javascript.
New keywords denote by *
- abstract*
- boolean*
- break*
- byte*
- case*
- catch*
- char*
- class
- 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*
- 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
ECMA Script: 5
No change since ECMAScript 3
ECMAScript 5 remove int, char, goto, long, final, float, short, double, native, throws, boolean, abstract, volatile, transient, and synchronized.
Get Rajdeep Singh’s stories in your inbox
Join Medium for free to get updates from this writer.
Two additional reserved keywords in javascript.
- break
- catch
- case
- class
- const
- continue
- debugger
- default
- delete
- do
- else
- enum
- export
- extends
- false
- finally
- for
- function
- if
- implements
- import
- in
- instanceof
- interface
- let*
- new
- null
- package
- private
- protected
- public
- return
- static
- super
- switch
- this
- throw
- true
- try
- typeof
- var
- void
- while
- with
- yield*
ECMA Script: 6
- await
- break
- case
- catch
- class
- const
- continue
- debugger
- default
- delete
- do
- else
- export
- extends
- finally
- for
- function
- if
- import
- in
- instanceof
- new
- return
- super
- switch
- this
- throw
- try
- typeof
- var
- void
- while
- with
- yield
Note:
The following keywords are not reserved, but when you use strict mode on javascript, that time shows an error.
- implements
- interface
- let
- package
- private
- protected
- public
- static
Other:
- true
- false
- null
- undefined
Reference:
Wrong
"use strict"function true(){} //Show Error In Strict Modelet await = 'rajdeep singh'; // Show Error with and without Strict Modelet case = 122 // Show Error with and without Strict Mojavade
Conclusion
Javascript reserved keywords can not be used as a variable Name, Label or Function, and Class Name when using a named variable that shows SyntaxError.
There are Any queries, mistakes, and Suggestions. Please, tell me in the comment box.










