構造函數、原型及原型鏈

一、構造函數 funcion Foo (name,age){ this.name=name; this.age=age; this.class='class-1'; return this;//默認return this,可不用寫 } var f = new Foo('gouhuan',18); var f2 = new Foo('zhaohuanling',18)
相關文章
相關標籤/搜索