List of Keywords and reverved words in Javascript

By: Emiley J. Emailed: 1642 times Printed: 2110 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

Keywords

By rule, keywords are reserved and cannot be used as variable or function names. Here is the complete list of JavaScript keywords:

break
case
catch
continue 
default 
delete 
do 
else
finally 
for 
function 
if 
in 
instanceof 
new
return
switch
this
throw
try
typeof
var
void
while
with

If you use a keyword as a variable or function name, you will probably be greeted with an error message like this: “Identifier expected.”

Reserved Words

JavaScript also defines a number of reserved words. The reserved words are, in a sense, words that are reserved for future use as keywords. Because of this, reserved words cannot be used as variable or function names. The complete list of reserved words in ECMA-262 Edition 3 is as follows:

abstract
boolean
byte 
char 
class 
const 
debugger 
double 
enum
export 
extends 
final 
float 
goto 
int
interface
implements
import
long
native
package
private
protected
public
short
static
super
synchronized
throws
transient
volatile

If you use a reserved word as a variable or function name, more than likely you will not receive an error...until a future browser implements one of them. Then the word will be considered a keyword, and you will get a keyword error.


Javascript Home | All Javascript Tutorials | Latest Javascript Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(0)


Be the first one to add a comment

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Emiley J.
Error generating R.java from manifest
ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client
IIS and Tomcat - how to configure to work together
PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/php4/lib/php/extensions/no-debug ......
Adding your own Application icon for your J2ME application (jar file)
Creating Menus in Code using VB.net
Traversing all files in a directory using Ruby
Using Proxy to connect to URLs in Ruby
POST a form in Ruby
Reading URL content using Ruby (HTTP)
dRuby client/server mode sample program
Benchmark module in Ruby
encoding and decoding in Ruby using Base64 Module
Module Abbrev in Ruby
Standard Library Packages in Ruby

More Tutorials in Javascript
Use WinSCP to transfer log files remotely using Javascript
Verifying user input in JavaScript
Pause execution in JavaScript
Javascript to display client date and time on webpage
Getting Browser's height and width using Javascript
Highlighting text on a page using CSS
Using revealTrans to do page transitions in Javascript
Password protect a web page using Javascript
Diabling Right Click option in a browser using Javascript
Scrolling message on the status bar using Javascript
window.frames[i] in Javascript
Form validation using Javascript
Using && in Javascript
The if statement in Javascript
do-while, while, for and for-in loops in Javascript

More Latest News
Most Viewed Articles (in Javascript )
Typecasting in Javascript
Using parseInt() and parseFloat() in JavaScript to convert data types to Numbers
Show how many characters remaining in a html text box using javascript
List of Keywords and reverved words in Javascript
Scrolling message on the status bar using Javascript
Getting Browser's height and width using Javascript
History and evolution of Javascript
Javascript Basics
do-while, while, for and for-in loops in Javascript
call() and apply() methods in Javascript
Pause execution in JavaScript
Bitwise NOT, AND, OR, XOR operators in Javascript
Using ! and !! in Javascript
The if statement in Javascript
switch in Javascript
Most Emailed Articles (in Javascript)
Click to remove an element from a select html form using javascript
Bitwise NOT, AND, OR, XOR operators in Javascript
this keyword sample in Javascript
Diabling Right Click option in a browser using Javascript
Getting Browser's height and width using Javascript
Show how many characters remaining in a html text box using javascript
History and evolution of Javascript
Using toString() in JavaScript to convert data types to String
Using parseInt() and parseFloat() in JavaScript to convert data types to Numbers
Using ! and !! in Javascript
Using && in Javascript
Highlighting text on a page using CSS
Using revealTrans to do page transitions in Javascript
Javascript to display client date and time on webpage
Verifying user input in JavaScript