19/33


#1

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

returns "your method failed when sidelength was 0 where it returned NaN instead of 0"


#2

Hi,
its a typo

return this.sidelength * this.sidelength; // change in this.sideLength