Hi can someone please help me out with this?

Instruction says to make second function as first one...

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.sideLength;

};

var p = square.calcPerimeter();

var a = square.calcArea();

and in response I have: "Your method failed when sideLength was 0 where it returned NaN instead of 0"

so I've tried this

var square = new Object();

square.sideLength = 6;

square.calcPerimeter = function() {

return this.sideLength * 4;

};

// help us define an area method here

square.calcArea = function() {

if( this.sideLength != 0;) {

return this.sideLenght * this.sideLength;

};

else { return 0; };

};

var p = square.calcPerimeter();

var a = square.calcArea();

it didn't helped either... Please can someone give me a hint what am I doing wrong here

(except believing that I ever be able to write code on my own...)