class Parent {
constructor() {
this._name = 'Иван'
}
get name() {
return this._name
}
}
class Child extends Parent {
constructor() {
super()
this._patronymic = 'Иванович'
}
get patronymic() {
return this._patronymic
}
getMsg() {
console.log(`${super.name} ${this.patronymic}`)
}
}
const child = new Child()
child.getMsg()