月薪80k大佬筆記,javascript之繼承!網友:「完美」!

1.傳統方式--->原型鏈 (過多繼承了沒用的屬性) Grand.prototype.lastname = 'zhang' function Grand(); } var grand = new Grand(); Father.prototype = grand; function Father(){ this.name = 'hehe'; } var father = new Father();
相關文章
相關標籤/搜索