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 ...
Get Object-Oriented JavaScript - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.