-
|
this의 값은 어떻게 결정되나요? |
Beta Was this translation helpful? Give feedback.
Answered by
hsmurf
Mar 29, 2024
Replies: 1 comment
-
|
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hsmurf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this의 값은 호출하는 방법에 따라 달라집니다.this는 전역 객체를 가리킵니다. 하지만 strict mode에서는 전역 객체를 가리키지 않고 undefined가 됩니다.this는 해당 메서드를 호출한 객체를 가리킵니다.this는 새로 생성된 객체(인스턴스)를 가리킵니다.call(),apply(),bind()를 사용하여 명시적으로this를 바인딩할 수 있습니다.this는 함수가 생성될 때의 상위 스코프의this를 참조합니다.