24.) Constructors with Methods: End of Input Error


#1

Just need help seeing what my problem is with my input

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 + 2 * this.width;
};

var rex = new Rectangle(7,3);
var area = rex.calcArea();
var perimeter = rex.calcPerimeter();
this.calcPerimeter = function() {
return this.height * this.width;
};


#2

You should close the Rectangle function by adding a curly brace before this

That should resolve the end of input error.


#3

Thank you! I see now that i got three { and only two } :smiley:


#4

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