Lesson 19 where is the error . Someone Pl help


#1

Here is the code.

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

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

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

console.log(a, p);


#2

@csscoder68873,
Change your

return this.sideLength * sideLength;

into

return this.sideLength * this.sideLength;