Maine,
function Animal(name) {
this.name = name
}
Animal.prototype.getName = function() {
return this.name;
}
function Dog(name) {
this.name = name
}
Dog.prototype = Animal.prototype;
Dog.prototype.bark = function () {
return ('Dog ' + this.name + ' is barking');
}
var dog = new Dog('Balto');
alert(dog.getName());
alert(dog.bark());