Last active
October 14, 2019 15:01
-
-
Save rodrigograca31/e2ec48b4877c31a787b8a5b177b20a4b 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
const person = { | |
name: 'Rodrigo', | |
age: 99, | |
how_old: function() { return this.name + ' is ' + this.age + ' old'} | |
} | |
person.how_old() | |
// Why dont arrow functions work with this? | |
// How do you solve it? | |
const person2 = { | |
name: 'Rodrigo', | |
age: 99, | |
how_old: () => this.age + ' is ' + this.age + ' old' | |
} | |
person2.how_old() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment