Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created July 6, 2016 02:49
Show Gist options
  • Save codecademydev/e5ef1ad2fc99e5929753266851e54695 to your computer and use it in GitHub Desktop.
Save codecademydev/e5ef1ad2fc99e5929753266851e54695 to your computer and use it in GitHub Desktop.
Codecademy export
var square = new Object();
square.sideLength = 6;
square.calcPerimeter = function() {
return this.sideLength * 4;
};
// help us define an area method here
square.calcArea = function() {
return this.sideLength * this.sideLength;
};
var p = square.calcPerimeter();
var a = square.calcArea();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment