JavaScript Keywords | List of Reserved Words

Keywords in JavaScript are pre-defined words that have specific meanings to the interpreter and that meanings cannot be changed. They are also called reserved words in JavaScript.

JavaScript provides a set of reserved keywords that are the part of syntax in the JavaScript language.

JavaScript’s keywords are used to perform actions in the program. For example, the let keyword tells the browser to create a variable:

let x = 10;

Here, let is a keyword that indicates that x is the name of a variable that stores a value 10. Since keywords have specific meaning in JavaScript language, we cannot use them to define variables, functions, or labels that have the same names as these keywords. For example:

let const = 20; // Invalid

Here, const cannot be a variable name because const is a keyword that is used to store a constant value.

Since JavaScript is a case-sensitive language, all keywords in JavaScript must be written in lowercase letters (small letters).

List of JavaScript Keywords (Reserved Words)


Table shows the list of commonly used total number of keywords (reserved words) in the JavaScript language. They are as follows:

abstractargumentsawait*booleanbreakbyte
casecatchcharclass*constcontinue
debuggerdefaultdeletedodoubleelse
enum*evalexport*extends*falsefinal
finallyfloatforfunctiongotoif
implementsimport*ininstanceofintinterface
let*longnativenewnullpackage
privateprotectedpublicreturnshortstatic
super*switchsynchronizedthisthrowthrows
transienttruetrytypeofvarvoid
volatilewhilewithyield

Note: Reserved words marked with* are new in ECMAScript 5 and 6.

Removed Reserved Words


The following JavaScript keywords have been removed from the ECMAScript 5/6 standard:

abstractbooleanbytechardoublefinal
floatgotointlongnativeshort
synchronizedthrowstransientvolatile

Note: Do not use these removed reserved words to define the name of variables. ECMAScript 5/6 does not have full support in all web browsers.

JavaScript Objects, Properties, and Methods


You should also abstain for using the name of pre-defined JavaScript objects, properties, and methods:

ArrayDateevalfunctionhasOwnPropertyInfinity
isFiniteisNaNisPrototypeOflengthMathNaN
nameNumberObjectprototypeStringtoString
undefinedvalueOf

In this tutorial, we have listed of all JavaScript keywords (reserved words) that should not be used as variables, functions, or labels names. We hope you will have understood all the basic points related to JavaScript reserved words.