摘要:function Polygon(iSliders){ //定义一个多边形 this.silders=iSliders;}Polygon.prototype.getArea=function(){ //为多边形定义一个去的面积的方法 return 0;}function Triangle(iBase,iHeight){ Polygon.call(this,3); //继承多边形对象 this.base=iBase; this.height=iHeight;}Triangle.prototype.getArea=function(){ //重写去的面积的方法 return 0.5*this.ba
阅读全文
浙公网安备 33010602011771号