let user = { name: 'mike' };
let info = { age: 30 };
let fe = ['JS', 'React'];
let lang = ['Korean', 'English'];
//그냥 합칠 경우
user = Object.assign(
{},
user,
info,
{
skills: [fe],
},
{
language: [lang],
}
);
console.log(user);
//rest parameter를 활용할 경우
user = {
...user,
...info,
[...fe, ...lang]
};