/*
function Animal(name){
this.name = name;
}
Animal.prototype.cry = function(voice){
console.log(voice + 'と鳴きました');
}
function Cat(name){
Animal.call(this, name);
}
Cat.prototype = Object.create(Animal.prototype);
Cat.prototype.contructor = Cat;
Cat.prototype.meow = function(){
Animal.prototype.cry.call(this, 'にゃー');
}
var cat = new Cat();
cat.meow();
class Animal {
contructor(name){
this.name = name;
}
cry(voice) {
console.log(this.name + 'は' + voice + 'と鳴きました');
}
}
class Cat extends Animal {
contructor(name){
super(name);
}
talk(voice){
super.cry(voice);
}
}
var cat = new Cat('タマ');
cat.talk('にゃー');