JS
2023. 1. 12.
230112 JS ES6 JSON에서의 Destructuring
//JSON형식에서 디스트럭쳐링 let list = [ { num: 1, title: "hello", info: [1, 2, 3], profile: { birth: "2023" } }, { num: 2, title: "bye", info: [4, 5, 6], profile: { birth: "2022" } } ] let [a, b] = list; //두번째 객체의 num,title let [, { num, title }] = list; console.log(num, title); //두번째 객체의 info let [, { info }] = list; console.log(info); //두번째 객체의 profile let [, { profile }] = list; console.log(profile); ..