19/33 help me please


#1

var square = new Object();
square.sideHeigth = 6;
square.calcPerimeter = function() {
return this.sideHeigth * 4;
};
// help us define an area method here
square.calcArea = function () {
return this.sideHeigth * this.sideHeigth;
};

var p = square.calcPerimeter();
var a = square.calcArea()

won't work
thanks in advance


#2

Hello javaace,
You mean 19/33 not 18 right? If so here is the right code:

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

Your error must have been the use if sideHeight instead of sideLength


#3

thanks i made a stupid mistake


#4

That was a big help thanks!