> For the complete documentation index, see [llms.txt](https://heunnajo.gitbook.io/zerocho-javascript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://heunnajo.gitbook.io/zerocho-javascript/undefined-35.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:

```
GET https://heunnajo.gitbook.io/zerocho-javascript/undefined-35.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
