Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created July 6, 2016 02:44
Show Gist options
  • Save codecademydev/a974f87b119bd4083cd72284b91112a7 to your computer and use it in GitHub Desktop.
Save codecademydev/a974f87b119bd4083cd72284b91112a7 to your computer and use it in GitHub Desktop.
Codecademy export
var bob = new Object();
bob.age = 17;
// this time we have added a method, setAge
bob.setAge = function (newAge){
bob.age = newAge;
};
bob.getYearOfBirth = function () {
return 2014 - bob.age;
};
console.log(bob.getYearOfBirth());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment