Help Constructors With Methods


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

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


#2

Anything you needed help with?


#3

already found whats wrong, thanks :smiley:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.