Whats wrong


#1



https://www.codecademy.com/courses/spencer-sandbox/3/5?curriculum_id=506324b3a7dffd00020bf661#


Oops, try again. There was a problem with your syntax.

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();
console.log(rex, area, perimeter);


#2

Put a curly bracket after this line:


#3

There is one already?

@coresurfer45467

I ran the code on repl.it

seems what Mohamed was suggesting above is half correct but you need to add another closing brace after the one you already have.


#5

The curly bracket which already exists is for Rectangle function.


#6

the mistake was of curly braces


#7

Yes... :slight_smile:


#8

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