标签:
var person1 = new Person(‘aa‘,20);
function Person (name,age) {
this.name = name;
this.age = age;
}
person1.constructor == Person //true
用来检测引用类型
person1 instanceof Person //true
person1 instanceof Object //true
var a =[]; a instanceof Array //true
与对象之间是否存在关系
Person.prototype.isPrototypeOf (person1) //true
Person.prototype.isPrototypeOf (Object) //false
标签:
原文地址:http://www.cnblogs.com/joya0411/p/4184581.html