nerv_,
ну ок
function Animal(name) {
this._name = name;
}
Animal.prototype.getName = function () {
return this._name;
};
function Cow(name) {
Animal.apply(this, arguments);
this.moo = function () {
return "Cow " + this.getName() + " says moo";
};
}
Cow.prototype = Object.create(Animal.prototype);
Cow.prototype.constructor = Cow;
var cow = new Cow("Milka");
alert(cow instanceof Animal);