Extending Classes
class User {
constructor(name, password) {
this.username = name;
this.password = password;
}
sayHi() {
console.log(`Hi! I', ${this.username}`);
}
}
class Admin extends User {
manage() {
console.log("manage website");
}
}
const tom = new Admin("Tom", "1234");
tom.manage();
tom.sayHi();
manage website
Hi! I’, Tom