Rectangle object (Debugging Needed)


#1


var rectangle = new Object();
rectangle.height = 3;
rectangle.width = 4;
// here is our method to set the height
rectangle.setHeight = function (newHeight) {
  this.height = newHeight;
};
// help by finishing this method
rectangle.setWidth = function (newWidth) {
  this.width = newWidth;
};

// here change the width to 8 and height to 6 using our new methods
rectange.setHeight(6);
rectange.setWidth(8);


#2

The spelling is a tad bit wrong here.


#3

Oops! I see it now.
Thanks!


#4

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