精通javascript(看书笔记)

变量的类型检查 //检测类型 var str = "Hello World"; if (typeof str=="string") {//使用typeof来判断对象类型的一个例子 } if (str.constructor==String) {//使用构造函数属性来判断对象的类型
相关文章
相关标签/搜索