Book Image

Object-Oriented JavaScript

By : Stoyan Stefanov, Stoyan STEFANOV
Book Image

Object-Oriented JavaScript

By: Stoyan Stefanov, Stoyan STEFANOV

Overview of this book

Table of Contents (18 chapters)
Object-Oriented JavaScript
Credits
About the Author
About the Reviewers
Preface
Built-in Functions
Regular Expressions
Index

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