Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created July 4, 2019 18:49
Show Gist options
  • Select an option

  • Save jsmanifest/3cbbc3e4647d7dcfa96a4c39b1e05906 to your computer and use it in GitHub Desktop.

Select an option

Save jsmanifest/3cbbc3e4647d7dcfa96a4c39b1e05906 to your computer and use it in GitHub Desktop.
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