What is wrong in this code, anybody help please


#1



Make sure to set rectangle's height to 6!


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
var setHeight = function(newHeight){
    this.height = newHeight;
    };
var rectangle = new Object();
rectangle.height = 6;
rectangle.setHeight = setHeight;
rectangle.setHeight(6);

var setWidth = function(newWidth) {
this.width = newWidth;    
};
var rectangle = new Object();
rectangle.width = 8;
rectangle.setWidth = setWidth
rectangle.setWidth(8);


#2

Your code is good up to the comment

//here change the width to 8 and height to 6 using our new methods

Delete everything after that and remember that format to call the new specs is this:
what you're changing.what you're changing about it(new spec);
Does this help?