-
-
Save codecademydev/d359e223c38ab1882a038ff209da15f3 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.setHeight(6); | |
rectangle.setWidth(8); | |
// here change the width to 8 and height to 6 using our new methods |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment