您好,欢迎访问一九零五行业门户网

JavaScript保留关键字汇总_javascript技巧

javascript 标准
所有的现代浏览器已经完全支持 es5(ecmascript 5)。
javascript 保留关键字(keyword)
javascript 的保留关键字(标识符)不可以用作变量、标签或者函数名。有些保留关键字是作为 javascript 以后扩展使用。
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
* 标记的关键字是 ecmascript5 中新添加的。
javascript 对象、属性和方法
您也应该避免使用 javascript 内置的对象、属性和方法的名称作为 javascript 的变量或函数名:
array date eval function hasownproperty
infinity isfinite isnan isprototypeof length
math nan name number object
prototype string tostring undefined valueof
java 保留关键字
javascript 经常与 java 一起使用。您应该避免使用一些 java 对象和属性作为 javascript 标识符:
getclass java javaarray javaclass javaobject javapackage
windows 保留关键字(reserved word)
javascript 可以在 html 外部使用。它可在许多其他应用程序中作为编程语言使用。
在 html 中,您必须(为了可移植性,您也应该这么做)避免使用 html 和 windows 对象和属性的名称作为 javascript 的变量及函数名:
alert all anchor anchors area
assign blur button checkbox clearinterval
cleartimeout clientinformation close closed confirm
constructor crypto
其它类似信息

推荐信息