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();

posted @ 2019-08-06 10:54  呼吸之间  阅读(478)  评论(0编辑  收藏  举报