class
by qwerew0
JavaScript
class Breed{
constructor(){
this.kind="maltese";
}
printKind(){
console.log(this.kind)
}
}
class Dog extends Breed{
constructor(){
super();
this.name="mango"
}
printName(){
console.log(this.name);
}
}
const dog= new Dog();
dog.printName();
dog.printKind();