24/33 -- (Problem with syntax)


#1

Here is my code:

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 = function() {
      return this.height*2 + this.width*2;
}

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

I've looked through other posts by other users with similar problems, but this code doesn't seem to be different from the ones that worked... I'd appreciate an extra set of eyes!!


#2

I just put a" }; " after the " }" before var rex and the code passed... although, nothing was calculated...


#3
    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 = function(height, weight) {
    return 2 * this.width + 2 * this.height;
  };
}

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

Maybe this will work