Course
Reserved Keywords
JavaScript Tutorial
This JavaScript tutorial is crafted for beginners to introduce them to the basics and advanced concepts of JavaScript. By the end of this guide, you'll reach a proficiency level that sets the stage for further growth. Aimed at empowering you to progress towards becoming a world-class software developer, this tutorial paves the way for a successful career in web development and beyond.
Reserved Keywords
Reserved Keywords in JavaScript
Reserved keywords in JavaScript are predefined words that serve specific purposes within the language. They are reserved for use by the JavaScript engine and cannot be redefined or used for any other purpose in your code.
Some examples of reserved keywords in JavaScript include
let
, const
, function
, if
, else
, return
, and many more.
For example, if you try to declare a variable with a name that is a reserved keyword like
let
:let let = 10; // SyntaxError: Unexpected token 'let'
This will result in a syntax error because
let
is a reserved keyword and cannot be used as an identifier for a variable.Reserved Keywords
Here is the list of reserved keywords; you can’t use them as an identifier
Reserved Keywords added in ES5 and ES6
Some new keywords are added in the ES5 and ES6 versions of JavaScript. However, some are currently in use, and some keywords are reserved for future versions.