List of Keywords and reverved words in Javascript
By: Emiley J.
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.
Archived Comments
1. Larryhaw
View Tutorial By: Larryhaw at 2017-07-29 16:29:31
2. Destinado a iniciar este regio, a forma geral, situa-se cerca de beira-mar, que inclu a Aberta de Gu
View Tutorial By: veja a Rio Promo Tours at 2017-07-28 20:16:01
3. Larryhaw
View Tutorial By: Larryhaw at 2017-07-27 09:52:11
4. Pr-do-sol na Areal do Arur: Certa burgo de pescadores
com certa areia fluminense banhada atr
View Tutorial By: https://plus.google.com/ at 2017-07-15 06:37:19
5. Hi i am kavin, its my first occasion to commenting anyplace, hen i read this article i
thoug
View Tutorial By: twitter.com at 2017-06-07 16:23:04
6. Howdy jjust wanted to give you a quick heads up. The words in your
content seem to be runnin
View Tutorial By: Runescape Money site at 2017-05-23 04:35:26
7. It's actually a nice and helpful piece of info. I am glad that
you shared this helpful infor
View Tutorial By: Alcobendas at 2017-03-23 15:19:22
8. My partner and I stumbled over here coming from a different web address and thought
I should
View Tutorial By: iphone 7 cases louis vuitton at 2016-10-31 13:36:05
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Use WinSCP to transfer log files remotely using Javascript
Verifying user input 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
Scrolling message on the status bar using Javascript
Diabling Right Click option in a browser using Javascript
Password protect a web page using Javascript
Using revealTrans to do page transitions in Javascript
Form validation using Javascript
window.frames[i] in Javascript
Math object and Math functions in Javascript