Home >Web Front-end >JS Tutorial >Summary of JavaScript reserved keywords_javascript tips
JavaScript Standard
All modern browsers already fully support ES5 (ECMAScript 5).
JavaScript reserved keyword (keyword)
Javascript reserved keywords (identifiers) cannot be used as variable, label or function names. Some reserved keywords are used by Javascript for future extensions.
abstract | arguments | boolean | break | byte |
case | catch | char | class* | const |
continue | debugger | default | delete | do |
double | else | enum* | eval | export* |
extends* | false | final | finally | float |
for | function | goto | if | implements |
import* | in | instanceof | int | interface |
let | long | native | new | null |
package | private | protected | public | return |
short | static | super* | switch | synchronized |
this | throw | throws | transient | true |
try | typeof | var | void | volatile |
while | with | yield |
* The keywords marked are newly added in ECMAScript5.
JavaScript objects, properties and methods
You should also avoid using the names of built-in JavaScript objects, properties, and methods as Javascript variable or function names:
Array | Date | eval | function | hasOwnProperty |
Infinity | isFinite | isNaN | isPrototypeOf | length |
Math | NaN | name | Number | Object |
prototype | String | toString | undefined | valueOf |
Java reserved keywords
JavaScript is often used together with Java. There are some Java objects and properties that you should avoid using as JavaScript identifiers:
getClass | java | JavaArray | javaClass | JavaObject | JavaPackage |
Windows reserved word
JavaScript can be used outside of HTML. It can be used as a programming language in many other applications.
In HTML, you must (and for the sake of portability, you should) avoid using the names of HTML and Windows objects and properties as Javascript variable and function names:
alert | all | anchor | anchors | area |
assign | blur | button | checkbox | clearInterval |
clearTimeout | clientInformation | close | closed | confirm |
constructor | crypto |