class類的使用

es5中的構造函數 在es5中尚未class的表示方式,當須要面向對象編程的時候就使用構造函數javascript function Point(x,y){ this.x=x; this.y=y } Point.prototype.show=function(){ console.log('我出來了') } 其中prototype是構造函數的原型對象 當每new一個對象實
相關文章
相關標籤/搜索