> For the complete documentation index, see [llms.txt](https://april.gitbook.io/learning-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://april.gitbook.io/learning-js/chapter-5./5.10-destructuring-assignment.md).

# 5.10 해체 할당 (destructuring assignment)

* 객체나 배열을 변수로 해체할 수 있음
* 객체를 해체할 때는 반드시 변수 이름과 객체의 프로퍼티 이름이 일치해야 함
* 다른 곳에서 가져온 객체나 배열에서 원하는 요소를 뽑아낼 때 사용

```javascript
//배열 선언
const arr =[1, 2, 3];
 
// 배열 해체 할당
let [x, y] = arr;
x; // 1 
y; // 2 
z; // 정의되지 않음
```
