class Person {
constructor(name, age, gender) {
this.name = name
this.age = age
this.gender = gender
}
}
class Student extends Person {
constructor(name, age, gender, school, xlass) {
super(name, age, gender)
this.school = school
this.xlass = xlass
}
}
var s = new Student('jack', 12, 'boy', 'fz1z', 4)
console.log(s.__proto__.__proto__ instanceof Object) // true
console.log(s.__proto__.__proto__.__proto__ === null) // false
如下: