- isPrototypeOf用于判断 一个对象是否是另一个对象的原型
- 只要调用者在传入对象的原型链上都会返回true
function Person(myName) {
this.name = myName;
}
function Student(myName, myScore) {
Person.call(this, myName);
this.score = myScore;
}
Student.prototype = new Person();
Student.prototype.constructor = Student;
let stu = new Student();
console.log(Person.prototype.isPrototypeOf(stu)); // true