Open In App

JavaScript | Reserved Words

Last Updated : 24 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In JavaScript, you cannot use these reserved words as variable names, label names, or function names.

Reserved Words:

abstract arguments boolean break byte
case catch char const continue
debugger default delete do double
else eval false final finally
float for function goto if
implements in instanceof int interface
long native new null package
private protected public return short
static switch synchronized this throw
throws transient true try typeof
var void volatile while with
yield        

Reserved Words added in ECMAScript 5 and 6:

awaits class enum export
extends import let super

Removed Reserved Words: The following reserved words have been removed from ECMAScript 5 and 6.

abstract boolean byte char
double final float goto
int long native short
synchronized throws transient volatile

Other Reserved Words: JavaScript can be used as the programming language in many applications.

alert all anchor area anchors
assign blur button checkbox clearInterval
clearTimeout clientInformation close closed confirm
constructor crypto decodeURI decodeURIComponent defaultStatus
document  element elements embed embeds
encodeURI encodeURIComponent escape event fileUpload
focus form forms frame innerHeight
innerWidth layer link location mimeTypes
navigate navigator frames frameRate  hidden
history image images offscreenBuffering open
opener option outerWidth outerHeight packages
pageXOffset pageYOffset parent parseFloat parseInt
password pkcs11 plugin prompt propertyIsEnum
radio reset screenX screenY scroll
secure select self setInterval setTimeout
status submit taint text textarea

HTML Event Handlers: The name of all HTML event handlers  should not be used in javascript

onblur onclick onerror
onfocus onkeydown onkeypress
onkeyup  onmouseover onload
onmouseup onmousedown onsubmit

Similar Reads

JavaScript SyntaxError "variable" is a reserved identifier
This JavaScript exception variable is a reserved identifier occurs if the reserved keywords are used as identifiers. Message: SyntaxError: The use of a future reserved word for an identifier is invalid (Edge) SyntaxError: "x" is a reserved identifier (Firefox) SyntaxError: Unexpected reserved word (Chrome) Error Type: SyntaxError What happened? Whe
1 min read
How to use the HTML reserved character ?
HyperText Markup Language (HTML), the most basic building block of the web page which defines a structure to it. The browser uses this markup language to manipulate data like text, images, and other content to display in the required format. HyperText refers to the links that connect webpages and markup defines the text document within tags. HTML r
3 min read
JavaScript Program to Find Shortest Distance Between Two Words in an Array of Words
Given an array of words and two target words, the task is to find the shortest distance (minimum number of words) between the two target words in the array. The distance is calculated by counting the number of words between the two target words, excluding the target words themselves. Approaches to find the shortest distance between two wordsTable o
2 min read
How to replace all words with another words in HTML ?
The JavaScript replace() method is used to replace any occurrence of a character in a string or the entire string. It searches for a string corresponding to either a particular value or regular expression and returns a new string with the modified values. One can also use regular expressions instead of strings for defining the character or string t
3 min read
How to Add Spaces Between Words Starting with Capital Letters using Regex in javaScript ?
In this article, we will see how to put space between words that start with capital letters, basically, we use the Regex in javascript. A regular expression is a sequence of characters that forms a search pattern. The search pattern can be used for text search and text to replace operations. A regular expression can be a single character or a more
2 min read
JavaScript Program for Converting given Time to Words
This article will show you how to convert the given time into words in JavaScript. The given time will be in 12-hour format (hh: mm), where 0 < hh < 12, and 0 <= mm < 60. Examples: Input : hh = 6, mm = 20Output : Six Hour, Twenty MinutesInput : hh = 8, mm = 24Output : Eight Hour, Twenty Four MinutesApproach: First, we create an array co
2 min read
Javascript Program To Reverse Words In A Given String
Example: Let the input string be "i like this program very much". The function should change the string to "much very program this like i" Examples: Input: s = "geeks quiz practice code" Output: s = "code practice quiz geeks" Input: s = "getting good at coding needs a lot of practice" Output: s = "practice of lot a needs coding at good getting" Rec
4 min read
Replace Multiple Words with K in JavaScript
Sometimes, while working with Javascript strings, we may face a problem in which we have to perform a replacement of multiple words with a single word. This can have applications in many domains like day-day programming and school programming. These are the following approaches:Table of Content Using join() and split() methodsUsing Regex and join()
5 min read
JavaScript Program to Find Words which are Greater than given Length k
In JavaScript, to find words that are greater than the given length k, we need to split an array into words and then filter out words based on their lengths. Table of Content Using split and filter methodsUsing forEach and an empty arrayUsing RegEx Using split and filter methodsIn this approach, we split the input string into an array of words usin
2 min read
Reverse Words Starting with Particular Characters using JavaScript
We need to create a JavaScript function that reverses the order of all words in a given sentence that begins with a specific character. JavaScript allows us to reverse the words in a sentence that start with specific letters. Examples: Input: str= "I like to cook delicious meals every day"Character ch: "d"Output:"I like to cook suoiliced meals ever
4 min read