Last active
March 11, 2018 14:52
-
-
Save MartinsAlexandre/3218e1a0df2dfcd8dab9b08f97479287 to your computer and use it in GitHub Desktop.
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
<script> | |
const profile = { | |
name: 'Alex', | |
getName() { | |
return this.name; | |
} | |
}; | |
console.log(profile.getName()); | |
</script> | |
//ou | |
<script> | |
const profile = { | |
name: 'Alex', | |
getName: function () { | |
return () => this.name; | |
} | |
}; | |
console.log(profile.getName()); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment