Appendix A. Reserved Words

This appendix provides two lists of reserved keywords as defined in ECMAScript 5 (ES5). The first one is the current list of words, and the second is the list of words reserved for future implementations.

There's also a list of words that are no longer reserved, although they used to be in ES3.

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 many browsers, error in IE 
    var o = {"break": 1}; // Always OK 
    alert(o.break);       // error in IE 
    alert(o["break"]);    // OK 

Keywords

The list of words currently reserved in ES5 is as follows:

  • break
  • case
  • catch
  • continue
  • debugger
  • default
  • delete
  • do
  • else
  • finally
  • for
  • function
  • if
  • in
  • instanceof
  • new
  • return
  • switch
  • this
  • throw
  • try
  • typeof
  • var
  • void
  • while
  • with
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.2.15