语法:父对象.prototype.isPrototypeOf(子对象)
代码栗子:
function Student(){ ???this.name = "小马扎"; ????this.age = 18;}var sky = new Student();var img = new Image();console.log(Student.prototype.isPrototypeOf(sky)); ???// trueconsole.log(Student.prototype.isPrototypeOf(img)); ???// false
JS 构造函数——判断父对象是否在子对象的原型链上
原文地址:http://www.cnblogs.com/minigrasshopper/p/8066824.html