What is wrong here?


#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;
};
rectangle.setWidth(8);
rectangle.newHeight(6);


#2

you need .setHeight not .newHeight


#3

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