js


//圣杯模式

    function inherit(Target,Origin){

    function F(){}

      F.prototype = Origin.prototype;
      Target.prototype = new F();
      Target.prototype.constuctor = Target;
      Target.prototype.uber = Origin.prototype;
                  }

      Father.prototype.lastName = 'susan';
      function Father(){}
      function Son(){}
      inherit(Son,Father);
      var father = new Father();
      var son = new Son();

原文地址:https://www.cnblogs.com/jie-xuan/p/11307601.html