We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object arrow 에서의 this는 왜 window일까요?
var obj = { a:()=>{console.log(this)} } obj.a() //result : window
The text was updated successfully, but these errors were encountered:
http://www.2ality.com/2012/04/arrow-functions.html 번역해서 확인해볼 것
Sorry, something went wrong.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this#Arrow_functions
예제의 var foo = (() => this); 에 하나를 더 추가해서 var fooFn = function() { return this; }; 두개를 비교해보면 이해가 편함 결론적으로 모호성이 없어짐
No branches or pull requests
object arrow 에서의 this는 왜 window일까요?
var obj = {
a:()=>{console.log(this)}
}
obj.a() //result : window
The text was updated successfully, but these errors were encountered: