討論串[問題] JavaScript的繼承問題
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
程式碼是在這裡看到的. http://openhome.cc/Gossip/JavaScript/ClassSimulation.html. function Circle(x, y, r) {. // 設定物件各自狀態. this.x = x;. this.y = y;. this.r = r;.
(還有296個字)
內容預覽:
[恕刪]. Cylinder.prototype 物件的 x, y, r 基本上都是 undefined,也不會被用到。. Cylinder 建構式中的 Circle.call(this, x, y, r); 就會幫 new 出來的物件. 加上 x, y, r。. 關於記憶體浪費,我做了一個簡單的小
(還有548個字)
首頁
上一頁
1
下一頁
尾頁