> For the complete documentation index, see [llms.txt](https://radlohead.gitbook.io/typescript-deep-dive/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://radlohead.gitbook.io/typescript-deep-dive/recap/this.md).

# this

함수 내에서 `this` 키워드에 대한 접근은 실제로 함수가 호출되는 방법에 의해 제어됩니다. 일반적으로 "호출 컨텍스트"라고 합니다.

예제:

```typescript
function foo() {
    console.log(this)
}

foo() // logs out the global e.g. `window` in browsers
let bar = {
    foo
}
bar.foo() // Logs out `bar` as `foo` was called on `bar`
```

`this`를 사용하기전에 명심할게 있습니다. 클래스에서 이 기능을 호출 컨텍스트에서 분리하려면 화살표 함수를 사용해야 합니다, [화살표 함수에 대해서 더 알아보기](/typescript-deep-dive/future-javascript/arrow-functions.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://radlohead.gitbook.io/typescript-deep-dive/recap/this.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
