Oops, try again. Your method failed when sideLength was 0 where it returned NaN instead of 0


#1
var square = new Object();
square.sideLength = 6;
square.calcPerimeter = function() {
  return this.sideLength * 4;
};
// help us define an area method here
square.calcArea = function () {
    return this.sideLength * this.sidelength;
    };

var p = square.calcPerimeter();
var a = square.calcArea();

#2

You once used sidelength instead of sideLength


#3

I wrote it like this but I get the same message of error. Help!

var square = new Object();
square.sideLength = 6;
square.calcPerimeter = function() {
return this.sideLength * 4;
};
// help us define an area method here
square.calcArea = function() {
return this.sideLenght * this.sideLenght;
};

var p = square.calcPerimeter();
var a = square.calcArea();


#4

And you've made a typo as well. in your area method you used ht at the end of Length twice instead of th