Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Функция наследования через прототипы
- * @param {function} Child Дочерний класс
- * @param {function} Parent Родительский класс
- * @returns {function} Дочерний класс, унаследованный от родительского
- */
- function extend(Child, Parent) {
- var F = function () {};
- F.prototype = Parent.prototype;
- Child.prototype = new F();
- Child.prototype.constructor = Child;
- Child.superclass = Parent.prototype;
- return Child;
- }
Add Comment
Please, Sign In to add comment