구조 분해 할당
구조 분해 할당이란?
배열이나 객체의 요소 및 프로퍼티들을 분해해 그 값들을 각각의 변수에 할당하는 자바스크립트의 표현식
예제
배열
배열의 구조분해는 index를 이용해 index의 순서대로 변수의 값을 할당한다.
let colors = ["green", "blue", "purple"];
let [c1, c2, c3] = colors;
console.log(c1); // green
console.log(c2); // blue
console....
woodstock.hashnode.dev2 min read