-
-
Save codecademydev/5bf18f76e5e284edc5e9984f49150618 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
function Rectangle(height, width) { | |
this.height = height; | |
this.width = width; | |
this.calcArea = function() { | |
return this.height * this.width; | |
} | |
}; | |
function Perimeter(height, width) { | |
this.height = height; | |
this.width = width; | |
this.calcPerimeter = function() { | |
return (this.height * 2) + (this.width * 2); | |
} | |
}; | |
var rex = new Rectangle(7,3); | |
var area = rex.calcArea(); | |
var perimeter = rex.calcPerimeter(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment