![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbVYV9z%2Fbtq8v9hGBEz%2FTKFyame1z3HaZN04jpzzCK%2Fimg.jpg)
[JavaScript] 'Destructuring - 구조 분해 할당'이란 무엇인가? (ES6)
·
JavaScript
Destructuring 구조 분해 할당 구문은 배열이나 객체의 속성을 해체하여 그 값을 개별 변수에 담을 수 있게 하는 JavaScript 표현식입니다. [MDN] 객체나 배열에서 필요한 값을 개별 변수에 저장하는 것 객체 디스트럭처링 (Object destructuring) const settings = { notifications: { follow: true }, color: { theme: "yello" }, }; // 프로퍼티 key값을 기준으로 Destructuring되어 할당된다. const { notifications: { follow }, color} = settings; console.log(follow, color); // true { theme: 'yello' } 예시 //선언 co..