배열

일반 문법

const likeFoods = ['apple' ,'banana', 'orange'];
const food1 = likeFoods[0];
const food2 = likeFoods[1];
const food3 = likeFoods[2];
console.log(food1, food2, food3);

비구조화 할당

const likeFoods = ['apple' ,'banana', 'orange'];
const [food1, food2, food3] = likeFoods;
console.log(food1, food2, food3);

객체

비구조화 할당

const animal = {
	animalName: '곰이',
	animalType: '고양이',
	animalAge : 20, 
	animalGender : 'male'
};

const {animalName: animalTitle, animalType, animalAge, animalGender} = animal;

console.log(animalTitle);
console.log(animalType);
console.log(animalAge);
console.log(animalGender);