B. JavaScript Reserved WordsReserved words are words that have special meaning to JavaScript. Therefore, they cannot be used as variable or function names. You'll recognize many of the reserved words from previous chapters, but others will be unfamiliar. Some of the latter group are future reserved words; i.e., it's expected that they'll be commands in future versions of JavaScript. They're being set aside now so that you won't have to revise your code when new revisions are released. These words are part of the JavaScript language as of ECMAScript version 3.
Additional words reserved for future use by ECMAScript 3:
As of this writing, ECMAScript version 4 has not been finalized. These words are likely to be added to the reserved words list, so you should avoid using them:
These words are likely to no longer be reserved, but we recommend that you still avoid using them:
Other identifiers to avoid: The object names used in Appendix A aren't officially reserved (outside of the keywords above), but as they are part of the JavaScript language, you shouldn't use them as function or variable names. If you do, abandon all hope; the results will be unpredictable. In addition, most browsers are case-sensitive, which means that they differentiate between Document and document. Internet Explorer is only sometimes case-sensitive, which means that, for example, it may not understand any difference between Document and document. Consequently, be aware that just because it works in one browser doesn't mean that it'll always work in others. Test, test, test. |