let arr = ["one", "two", "three"];
let one = arr[0];
let two = arr[1];
let three = arr[2];
console.log(one, two, three);
------------------ 위를 간략하게 입력해보면 ------------------------------
let arr = ["one", "two", "three"];
let [one, two, three] = arr; //이는 해당 arr 배열에 인덱스에 맞게 해당 변수를 할당 시
console.log(one, two, three);
------------------ 더 단축 하면-----------------------------
let [one, two, three, four = "four"] = ["one", "two", "three"];
console.log(one, two, three, four); //이렇게 기본값을 할당할 수 있다

let a = 10;
let b = 20;
[a, b] = [b, a];
console.log(a, b);

객체를 비 구조화 할당하려면 인덱스를 기준이 아니라 key값을 기준으로 해야함
let object = { one: "one", two: "two", three:"three"};
let one = object["one"];
let two = object.two;
let three = object.three;
console.log(one, two, three);
------------------------- 간단하게 하면---------------------------------
let object = { one: "one", two: "two", three:"three", name: "이정환"};
let {name, one, two, three } = object;
console.log(one, two, three, name);
------ key값을 할당할 때 다른 이름으로 사용하는 법--------------------
let object = { one: "one", two: "two", three:"three", name: "이정환"};
let {name:myName, one:oneOne, two, three, abc = "four" } = object;
console.log(oneOne, two, three, myName, abc );

