Created
September 4, 2017 19:58
-
-
Save hvitorino/33bc1d8b669136498ed5dc786ec136fc 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
this.name = "Heisenberg"; | |
let obj = { | |
name: "i'm obj", | |
sayMyName: function() { | |
console.log(this.name); | |
}, | |
sayMyArrowName: () => console.log(this.name) | |
}; | |
obj.sayMyName(); | |
obj.sayMyArrowName(); | |
let anotherObj = { | |
name: "i'm another obj" | |
} | |
obj.sayMyName.bind(anotherObj)(); | |
obj.sayMyArrowName.bind(anotherObj)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Achei um ótimo recurso do ES6, apesar dessa inconsistência. JavaScript tá ficando fofo. Ainda não sei muito sobre ES7 mas chego lá.