분해할 구조를 미리 써줌
// 배열 구조 분해전
const arr = [1, 2, 3];
const one = arr[0];
const two = arr[1];
const three = arr[2];
console.log(one, two, three);
// 배열 구조 분해 사용
const [deOne, deTwo, deThree] = arr;
console.log(deOne, deTwo, deThree);
// 날짜
const today = new Date();
console.log(today);
// toISOString 규정화된 형태로 날짜값을 바꿔줌
const formatDay = today.toISOString().substring(0, 10);
console.log(formatDay);
const todayArr = formatDay.split('-');
// 구조 분해
const [year, month, day] = formatDay.split('-');
// const year = formatDay.split('-')[0];
// console.log(todayArr);
console.log(year, month, day);