javascript 繼承實現方式

call()方法 call()方法是與經典的對象冒充方法最類似的方法。它將第一個參數做this的對象。其它參數都是直接傳給函數自身。例如:    function ClassA(sColor){     this.color=sColor;     this.sayColor=function(){      alert(this.color);     }    }    function Cl
相關文章
相關標籤/搜索