R
Size: a a a
R
ДЗ
ДЗ
R
R
R
NR
R
TK
TK
S
БО
${this.name} ${this.surname}
;i'm ${this.getFullname()} i can read
i'm ${this.getFullname()} i can write
S
class User {
constructor(name, surname) {
this.name = name;
this.surname = surname;
}
getFullname() {
return `${this.name} ${this.surname}`;
}
}
class Admin extends User {
constructor(name, surname) {
super(name, surname);
}
read() {
return `i'm ${this.getFullname()} i can read`;
}
write() {
return `i'm ${this.getFullname()} i can write`;
}
}
const admin = new Admin("Dmytro", "Yummy", "dmytro@test.com", 1995);
console.log(admin.read());
БО
S
S
S
S
const Admin = function (name, surname) {
User.call(this, name, surname);
this.read = () => {
return `i'm ${this.getFullname()} i can read`;
};
this.write = () => {
return `i'm ${this.getFullname()} i can write`;
};
};