// 原型构造函数 function Rectangle(x,y){ this.x = x; this.y = y; } Rectangle.prototype.perimeter = fun
// 原型构造函数
function Rectangle(x,y){
this.x = x;
this.y = y;
}
Rectangle.prototype.perimeter = function(){
return 2*(this.x + this.y);
}
var rect = new Rectangle(1,2);
console.log(rect.perimeter());