totn JavaScript

JavaScript: Reserved Words

This JavaScript tutorial explains all about reserved words in JavaScript with examples.

Description

There are reserved words that have special meaning in JavaScript and can not be used in your code as variables, function names or loop labels.

It is important to note that JavaScript is a case-sensitive language (whereas HTML is not case-sensitive). As a result, you may notice uppercase letters within some of the JavaScript reserved words listed below.

Reserved Words

Here is a list of reserved words (and words to avoid) in JavaScript:

abstract

boolean

break

byte

case

catch

char

class

continue

const

debugger

default

delete

do

double

else

enum

export

extends

false

final

finally

float

for

function

goto

if

implements

import

in

instanceof

int

interface

long

native

new

null

package

private

protected

public

return

short

static

super

switch

synchronized

this

throw

throws

transient

true

try

typeof

var

void

while

with

Other Reserved Words to Avoid

Here is a list of words to avoid that are are used as names of properties, methods and consructors in JavaScript. You should also try not to use these names as you risk overwriting existing functionality in JavaScript:

alert

arguments

Array

blur

Boolean

callee

caller

captureEvents

clearInterval

clearTimeout

close

closed

confirm

constructor

Date

defaultStatus

document

escape

eval

find

focus

frames

Function

history

home

Infinity

innerHeight

innerWidth

isFinite

isNaN

java

length

location

locationbar

Math

menubar

moveBy

name

NaN

netscape

Number

Object

open

opener

outerHeight

outerWidth

Packages

pageXOffset

pageYOffset

parent

parseFloat

parseInt

personalbar

print

prompt

prototype

RegExp

releaseEvents

resizeBy

resizeTo

routeEvent

scroll

scrollbars

scrollBy

scrollTo

self

setInterval

setTimeout

status

statusbar

stop

String

toolbar

top

toString

unescape

unwatch

valueOf

watch

window