摘自:《JavaScript Visual QuickStart Guide (8th Edition)》。
Reversed words are words that have special meaning to JavaScript. Therefore, they cannot be used as variable or function names.
ECMAScript Edition 3 Reserved Words
These words are part of the JavaScript language as of ES3.
- break
- case
- catch
- continue
- default
- delete
- do
- else
- finally
- for
- function
- if
- in
- instanceof
- new
- return
- switch
- this
- throw
- try
- typeof
- var
- void
- while
- with
ES3 Future Reserved Words
- abstract
- boolean
- byte
- char
- class
- const
- debugger
- double
- enum
- export
- extends
- final
- float
- goto
- implements
- import
- int
- interface
- long
- native
- package
- private
- protected
- public
- short
- static
- super
- synchronized
- throws
- transient
- volatile
ECMAScript Edition 5 Reserved Words
This is ES5’s list of reserved words. It’s similar to that of ES3, but given that browsers primarily suppot ES3, we recommend that you keep both lists in mind.
- break
- case
- catch
- continue
- debugger
- default
- delete
- do
- else
- finally
- for
- function
- if
- in
- instanceof
- new
- return
- switch
- this
- throw
- try
- typeof
- var
- void
- while
- with
ES5 Future Reserved Words
- class
- const
- enum
- export
- extends
- implements
- import
- interface
- let
- package
- private
- protected
- public
- static
- super
- yield
Oter identifiers to avoid
These (along with the object names) aren’t officially reserved, but as they are (or may be) 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
- abstract
- arguments
- Array
- Boolean
- byte
- call
- cast
- char
- Date
- decimal
- decodeURI
- decodeURIComponent
- double
- dynamic
- each
- encodeURI
- encodeURICompnent
- Error
- eval
- EvalError
- false
- final
- float
- Function
- generator
- get
- goto
- has
- include
- Infinity
- int
- internal
- intrinsic
- is
- isFinite
- isNaN
- JSON
- like
- long
- Math
- namespace
- NaN
- native
- null
- Number
- Object
- override
- parseFloat
- parseInt
- precision
- prototype
- RangeError
- ReferenceError
- RegExp
- rounding
- set
- short
- standard
- strict
- String
- synchronized
- SyntaxError
- throws
- to
- transient
- true
- type
- TypeError
- uint
- undefined
- URIError
- use
- volatile
- xml
最新评论
大哥资深网民啊,01年我还在念小学。。
看着有点难过。。。
嘿嘿,谢谢老哥,也祝老哥事业蒸蒸日上。
我是你唯一的药学类友情链接网站。 作为一个80后的过来人祝福你,生活越来越好。
这篇文章,我们中学那会老师课堂上念给我们听的。
哈哈哈哈哈,没想到啊, 我有手抄版
嗯,是的
好心办坏事多了去啦
哈哈,是的,我15年末来上海写代码了,一晃三年多过去了,好快。
今天看QQ好友的时候突然看到了你的名字,想起几年前在药品国际注册群挺活跃/厉害的你,现在不见踪影了。就搜了一下,没想到你现在转行去写代码了... (刚才打漏了一句话...)