19. Help with Square Area Object


#1



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


i get this error message, I can't figure out what could be wrong.
"Oops, try again. Your method failed when sideLength was 0 where it returned NaN instead of 0"


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();

console.log(a, p);


#2

You accidentally said "this.side l ength" rather than "this.side L ength" for square.calcArea