Created
February 28, 2018 14:07
-
-
Save Bastiani/a91815ce4a23ceaee21adf1e5f44f62d 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
function Person() { | |
this.name = 'Rafael'; | |
this.age = 36; | |
return { | |
getName: () => { | |
return this.name; | |
}, | |
getAge: () => { | |
return this.age; | |
}, | |
} | |
} | |
const person = new Person; | |
console.log(person[false ? 'getName' : 'getAge']()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment