Created
July 4, 2019 18:49
-
-
Save jsmanifest/3cbbc3e4647d7dcfa96a4c39b1e05906 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const someFunction = function () { | |
| const store = { | |
| people: { | |
| joe: { | |
| age: 16, | |
| gender: 'boy', | |
| }, | |
| bob: { | |
| age: 14, | |
| gender: 'transgender', | |
| } | |
| } | |
| } | |
| return { | |
| getPersonsProfile(name) { | |
| return store.people[name] | |
| }, | |
| foods: ['apple', 'pineapple'], | |
| } | |
| } | |
| const obj = someFunction() | |
| const joesProfile = obj.getPersonsProfile('Joe') | |
| const joesAge = joesProfile.age | |
| console.log(joesAge) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment