구조분해할당-기초?예시
배열이나 객체의 속성을 해체하여 그 값을 개별 변수에 담을 수 있게하는 javaScript 표현식입니다. let a, b, rest; [a, b] = [10, 20]; console.log(a); // Expected output: 10 console.log(b); // Expected output: 20 [a, b, ...rest] = [10, 20, 30, 40, 50]; console.log(rest); // Expected output: Array [30, 40, 50] 위의 코드를 말로 푼다면 [10,20]배열을 [a,b]에 하나씩 할당을 해주면서 a = 10, b= 20이 되게됩니다. 이제 객체를 분해해보겠습니다. let demo = {c:123,d:"too"} let {c,d} = demo;..