JavaScript关键词与JavaScript保留字

Javascript关键字(Reserved Words)是指在Javascript语言中有特定含义,成为Javascript语法中一部分的那些字。Javascript关键字是不能作为变量名和函数名使用的。使用Javascript关键字作为变量名或函数名,会使Javascript在载入过程中出现编译错误。

Javascript关键字列表:
break delete function return typeof
case do if switch var
catch else in this void
continue false instanceof throw while
debugger finally new true with
default for null try

Javascript未来关键字(Javascript Future Reserved Words)
Javascript还有一些未来关键字,这些字虽然现在没有用到Javascript语言中,但是将来有可能用到。

Javascript未来关键字列表:
abstract double goto native static
boolean enum implements package super
byte export import private synchronized
char extends int protected throws
class final interface public transient
const float long short volatile

 

Javascript保留字不可以用作变量,函数名,对象名等,其中有的保留字是为以后Javascript扩展用的.

 

  1. abstract
  2. boolean break byte
  3. case catch char class const continue
  4. debugger default delete do double
  5. else enum export extends
  6. false final finally float for function
  7. goto
  8. if implements import in instanceof int interface
  9. long
  10. native new null
  11. package private protected public
  12. return
  13. short static super switch synchronized
  14. this throw throws transient true try typeof
  15. var void volatile
  16. while with

原创文章,作者:Da Zhuang,如若转载,请注明出处:https://www.lidazhuang.cn/web/326.html

(0)
上一篇 2015年1月22日
下一篇 2015年1月30日
联系我