Created
June 20, 2016 14:15
-
-
Save 1dolinski/8e531f2b17d2910587626bf8a3726ec4 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
| var test = { | |
| result: "result", | |
| zero: function() { | |
| return this.result; | |
| }, | |
| one: function() { | |
| return test.result; | |
| }, | |
| two: () => { | |
| return this.result; | |
| }, | |
| three: () => { | |
| return test.result; | |
| } | |
| } | |
| console.log(test["zero"]()); // #=> result | |
| console.log(test["one"]()); // #=> result | |
| console.log(test["two"]()); // #=> undefined | |
| console.log(test["three"]()); // #=> result | |
| // How can I use 'this', in test["two"]()? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment