kostyanet,
Да
var SomeConstructor = function(name, age) {
this.name = name;
this.age = age;
};
SomeConstructor.prototype.getName = function () {
return this.name;
};
SomeConstructor.prototype.addAge = function () {
return this.age++;
};
var SomeChild = function () {
SomeConstructor.apply(this,arguments)
};
SomeChild.prototype = Object.create(SomeConstructor.prototype);
SomeChild.constructor = SomeChild;
SomeChild.prototype.childMethod = function () {
return true;
}
var child = new SomeChild("child", 20);
alert(JSON.stringify(child, "", 4));
alert(child.childMethod());