-
-
Save codecademydev/a974f87b119bd4083cd72284b91112a7 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 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