class Animal { constructor(name) { this.name = name; } } class Dog extends Animal { constructor(name) { super(name); } bark(dogName) { return this.name + dogName; } } let dog = new Dog('Balto'); console.log(dog.name); console.log(dog.bark('test'));