en.javascript.info/1-js/9-object-inheritance/10-class-inheritance/4-clock-class-extended/source.view/extended-clock.js
Ilya Kantor b0976b5253 up
2016-11-14 23:41:18 +03:00

13 lines
No EOL
259 B
JavaScript

function extend(Child, Parent) {
Child.prototype = inherit(Parent.prototype);
Child.prototype.constructor = Child;
Child.parent = Parent.prototype;
}
function inherit(proto) {
function F() {}
F.prototype = proto;
return new F;
}
// ваш код