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

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

**nicomere**#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();

**haxor789**#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`