编辑代码

console.log('现在是晚上23:21')



class Father {

    constructor(name, age) {
        this.name = name
        this.age = age

        this.sayHello = () => {
            console.log('hhhh')
        }

    }

    getInfo() {
        console.log(this)
    }



}




let father1 = new Father('zhangsan', 18)


console.log(father1.__proto__)

console.log(Father.prototype)

console.log(father1)

father1.getInfo()

father1.sayHello()



class Son extends Father {

    constructor(name, age) {

        super(name, age)

    }



}

const son1 = new Son('zhangsan', 18)

console.log(son1)