객체의 값을 새로운 객체에 펼쳐주는 역할
배열에서도 사용 가능
const cookie = {
base : "cookie",
madeIn : "korea"
};
const chocoCookie = {
base : "cookie",
madeIn : "korea",
toping : "choco"
};
const bananaCookie = {
base : "cookie",
madeIn : "korea",
toping : "banana"
};
const cookie = {
base : "cookie",
madeIn : "korea"
};
const chocoCookie = {
...cookie,
toping : "choco"
};
const bananaCookie = {
...cookie,
toping : "banana"
};
console.log(chocoCookie);