APPENDIXJavaScript Reserved Words
All languages, including JavaScript, have numerous reserved words that cannot be used as variable names, function names, or any other form of identifiers without causing some problem. If one of these reserved words is used as a user-defined identifier, such as a variable or function name, it should result in a syntax error. For example, the following declares a variable called for, which, as you have seen, is a JavaScript keyword used for looping:
You should expect some form of error to occur if you misuse the reserved identifier:
Generally speaking, reserved words are reserved from use because they already have ...
Get JavaScript The Complete Reference, 3rd 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.