Perimeter question


#1

function Rectangle(height, width) {
this.height = height;
this.width = width;
this.calcArea = function() {
return this.height * this.width;
};
// put our perimeter function here!

rectangle.calcPerimeter = function(){
return 2 * this.height + 2 * this.width;
};

var rex = new Rectangle(7,3);
var area = rex.calcArea();
var perimeter = rex.calcPerimeter();

this is my code for introduction to objects 24/33 task


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.