> For the complete documentation index, see [llms.txt](https://organization-bht.gitbook.io/it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://organization-bht.gitbook.io/it/undefined-1/html-css-js-es5/js.md). Agents can also search and read this documentation through its [MCP server](https://organization-bht.gitbook.io/it/~gitbook/mcp).

# JS

## 1. 웹 브라우저의 메모리

<figure><img src="https://3572862491-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUON3CGxVeoUR2YdtAhxl%2Fuploads%2FxcnPcawm2ax1JvSovAQb%2F%EB%B8%8C%EB%9D%BC%EC%9A%B0%EC%A0%80%20%EB%A9%94%EB%AA%A8%EB%A6%AC.png?alt=media&amp;token=ec03cdf0-ace9-4ef4-aca5-378780034b8d" alt=""><figcaption></figcaption></figure>

* 웹 브라우저는 Single Thread방식으로 동작한다
* 브라우저에서 js를 통해 실행한 함수, 이벤트들은 Stack영역에 Frame단위로 쌓인다
* 실행할 함수가 비동기 함수인 경우 해당 Frame은 Queue로 이동한다.
* Stacke의 메모리가 모두 비워지면 Queue에 저장된 비동기 함수들이 다시 Stack으로 이동하여 실행된다.

## 2. Event Bubbling

## 3. KeyEvent
