> For the complete documentation index, see [llms.txt](https://onemorebottlees-organization.gitbook.io/onemorebottlees-til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://onemorebottlees-organization.gitbook.io/onemorebottlees-til/lecture/udemy/typescript-with-webpack-and-react/s12-class.md).

# \[S12] Class

**Class in JS**

패턴을 생성하는 역할

객체를 나타낼 때 프로퍼티와 기능을 함께 나타낸다.

인스턴스화 가능하다.

<figure><img src="/files/NByiL58rYBlhxTOWNw09" alt=""><figcaption></figcaption></figure>

변수명 앞에 #을 붙이면 Private 설정. 클래스 외부에서 호출 불가능함

constructor - 생성자. 객체 생성시 호출됨

**Getter / Setter**

접근자 프로퍼티

프로퍼티로 설정하지 않았지만 프로퍼티처럼 행동하는 문법적 설탕.

Getter

![](/files/k7Nj7BOeTHcJDieOXKrD)

get 함수명(){}

값을 가져올 수 있다.

Setter

![](/files/YD0B0DghTU1v07oXbEXl)

즉각적으로 값을 변경하는 프로퍼티와 달리 조건부로 변경하는등 통제할 수 있다.

![](/files/denKEcBdZMM1ZzwbTmPw)![](/files/EceWDRY7awMMyBSp7JmE)![](/files/yY8pAaKgwyWULaEJSqLw)

SON HM ⇒ Kim MJ 변경 완료

**Static**

개별 인스턴스가 아닌 클래스 차원에서 사용할 기능 설정할때 사용

![](/files/oao7HrzgRe0LbsouFnhj)![](/files/uuawaqNICdybjOIo3MdG)

**Extends**

확장.

![](/files/cl0wukDxTKaw9QdR1Lw9)![](/files/UY3TsIf1K6mphSPmHP7r)

Player 의 모든 메서드, 프로퍼티 사용 가능

**Super**

자식 클래스에 생성자를 추가할 때 사용

![](/files/5bG1GmgQgmGSdc0dQ4ar)![](/files/VXbbiXln0sIhcv9upSv3)


---

# 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://onemorebottlees-organization.gitbook.io/onemorebottlees-til/lecture/udemy/typescript-with-webpack-and-react/s12-class.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.
