Do the methods run even without calling them?


#1



Replace this line with your 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 2*(this.height+this.width);
};
};
var rex = new Rectangle(7,3);
var area = rex.calcArea();
var perimeter = rex.calcPerimeter();


#2

no for a method or object to run you must create and call one that inherits all the methods properties :slight_smile:


#3

hey can you be more specific?


#4

You see what you did here, You created an instance of the rectangle method. And by doing that you have made your rectangle object callable. Think about objects as very flexible solid functions and for a function to run it must be called.

Like you did here,

You called the 2 functions nested within the rectangle object. It's like saying these two functions are the actions that your rectangle can perform.