JS高级---逆推继承看原型

逆推继承看原型

 

 

 

    function F1(age) {
      this.age = age;
    }
    function F2(age) {
      this.age = age;
    }
    F2.prototype = new F1(10);
    function F3(age) {
      this.age = age;
    }
    F3.prototype = new F2(20);

    var f3 = new F3(30);
    console.log(f3.age);//
posted @ 2020-01-06 18:17  jane_panyiyun  阅读(258)  评论(0编辑  收藏  举报