Last Updated: February 25, 2016
·
610
· iankitshah

JavaScript: Reserved Words

JavaScript has a number of reserved words that you cannot use as identifiers. Reserved words have a specific meaning to the JavaScript language, as they are part of the language syntax. Using a reserved word causes a compilation error when loading your script.

List of Reserved words

- break    - default    - function    - return    - var        - case
- delete   - if         - switch      - void      - catch      - do
- in       - this       - while       - const     - else       - instanceof
- throw    - with       - continue    - finally   - let        - try    
- for,     - new        - debugger

JavaScript also has a list of future reserved words. These words are not currently part of the JavaScript language, although they are reserved for future use.

Original source and more info:
http://msdn.microsoft.com/en-us/library/hh699851(v=vs.94).aspx

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#javascript
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside