19. More Kinds of Methods


#1



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


I can not find where is the problem.
The error message is "Your method failed when sideLength was 0 where it returned NaN instead of 0"
but in console I see - NaN 24.
But I expect to see 24, 36


var square = new Object();
square.sideLength = 6;

square.calcPerimeter = function(){
  return this.sideLength * 4;
};

square.calcArea = function(){
  return this.sideLenght * this.sideLenght;  
};
var p = square.calcPerimeter();
var a = square.calcArea();

console.log(a, p);


#2

Hi
2 typos : replace sideLenght by sideLength


#3

Thanks, now I got it!