24/33


#1

function Rectangle(height, width) {
this.height = height;
this.width = width;
this.calcArea = function() {
return this.height * this.width;
};
// put our perimeter function here!
this.calcParimeter =function(){
return 2 * this.height + 2 * this.width;
}
}

var rex = new Rectangle(7,3);
var area = rex.calcArea();
var perimeter = rex.calcPerimeter();

It says that rex.Perimeter is not a function...Would it be a syntax error?


#2

this.calcParimeter


#3

Try this:

this.calcPerimeter = function(){
return (this.width + this.height) * 2;
};

:smiley: