class Father {
#account = 0
constructor(name){
this.name = name
this.printName = this.printName.bind(this)
}
static getStatic(){
console.log(1)
}
printName(name = 'there') {
this.print(`Hello ${name}`);
}
print(text) {
console.log(text);
}
}
const father = new Father('伟杰')
console.log(father.__proto__ === Father.prototype)
console.log(father.constructor === Father)
console.log(Father.prototype.constructor === Father)
class Children extends Father{
constructor(...arg){
super(...arg)
}
}
const children = new Children('沐晨')
console.log(children instanceof Children)
console.log(children instanceof Father)