Appendix A. Reserved Words

This Appendix provides two lists of reserved keywords. The first one is the current list of reserved words, and the second is the list of words reserved for future implementations.

You cannot use reserved words as variable names.

var break = 1; // syntax error

If you use these words as object properties, you have to quote them.

var o = {break: 1};   // OK in Firefox, error in IE
var o = {'break': 1}; // OK
alert(o.break);       // error in IE
alert(o['break']);    // OK

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

Future Reserved Words

  • abstract

  • boolean

  • byte

  • char

  • class

  • const

  • debugger

  • double ...

Get Object-Oriented JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.