巴黎圣母院的好詞好句
javascript面向對象中繼承實現

javascript面向對象中的繼承實現一般都使用到了構造函數和Prototype原型鏈,簡單的代碼如下:
function Animal(name) {
this.name = name;
}
Animal.prototype.getName = function() {alert(this.name)}
function Dog() {};
Dog.prototype = new Animal("Buddy");
Dog.prototype.constructor = Dog;
var dog = new Dog();
【巴黎圣母院的好詞好句】相關文章:
巴黎圣母院有感07-17
經典好詞好句07-28
好詞好句:重陽節作文好詞好句04-13
童話好詞好句10-16
愛的好詞及好句11-15
兒童好詞好句07-14
松樹的好詞好句08-21
好詞好句的例子05-18
《故鄉》好詞好句10-10
奉獻的好詞好句01-03
- 相關推薦