Skip to content

Conversation

@Sun4-me
Copy link
Member

@Sun4-me Sun4-me commented Mar 13, 2023

22. this

✏️ 기억에 남는 내용

  • this는 자신이 속한 객체 또는 자신이 생성할 인스턴스를 가리키는 자기 참조 변수다. this를 통해 자신이 속한 객체 또는 자신이 생성할 인스턴스의 프로퍼티나 메서드를 참조할 수 있으며, this 바인딩은 함수 호출 방식에 의해 동적으로 결정된다.

  • 일반 함수로 호출된(중첩 함수, 콜백함수 포함)모든 함수 내부의 this에는 전역객체가 바인딩되며, strict mode에서는 undefined가 바인딩된다.

  • 생성자 함수 내부의 this에는 생성자 함수가 생성할 인스턴스가 바인딩된다.

  • apply, call, bind 메서드는 Function.prototype의 메서드로, 모든 함수가 상속받아서 사용할 수 있다.


📝 간단한 퀴즈

  1. apply, call, bind 메서드의 각각의 특징들을 간단히 서술하시오.

🧑🏻‍💻 연관 코드

// 관련 코드를 적어주세요.

@Sun4-me Sun4-me requested a review from L2HYUNN as a code owner March 13, 2023 10:15
@Sun4-me Sun4-me self-assigned this Mar 13, 2023
@Sun4-me Sun4-me linked an issue Mar 13, 2023 that may be closed by this pull request
Copy link
Contributor

@BARAM1NG BARAM1NG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@LSH-0125 LSH-0125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@L2HYUNN L2HYUNN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sun4-me Sun4-me merged commit 5d71374 into main Mar 15, 2023
@Sun4-me Sun4-me deleted the 22/Sun4-me branch March 15, 2023 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

22. this

5 participants