Created
November 13, 2018 23:59
-
-
Save krfong916/2a4a0a7429612a3b64b01bd1e64e8012 to your computer and use it in GitHub Desktop.
lexical this and this properties
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
// lexical this and this properties | |
function test() { | |
setTimeout(() => { | |
console.log(this.a) | |
}, 1000); | |
} | |
let a = 2; | |
test(); | |
let obj = { | |
a: 5 | |
} | |
test.call(obj); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment