18. Make your own method


#1


https://www.codecademy.com/courses/spencer-sandbox/2/6?curriculum_id=506324b3a7dffd00020bf661#


After running this code it tells me, Oops, try again. Make sure to set rectangle's width to 8!


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
rectangle.setHeight=(6);
rectangle.setWidth=(8);


#2

when you set an argument/parameter for your functions you usually place them in parenthesis for example:
function(argument);


#3
object.method(argument)

#5