24. Constructors With Methods


#1

I need help im confused

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

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


#2

Hi here

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

Instead of height and width try this.height and this.width


#3

There is a slight spelling mistake "function"