Guest User

Untitled

a guest
Oct 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /**
  2. * Функция наследования через прототипы
  3. * @param {function} Child Дочерний класс
  4. * @param {function} Parent Родительский класс
  5. * @returns {function} Дочерний класс, унаследованный от родительского
  6. */
  7. function extend(Child, Parent) {
  8. var F = function () {};
  9. F.prototype = Parent.prototype;
  10. Child.prototype = new F();
  11. Child.prototype.constructor = Child;
  12. Child.superclass = Parent.prototype;
  13.  
  14. return Child;
  15. }
Add Comment
Please, Sign In to add comment