const user = { name: 'user', password: 'user'}
const admin = { name 'admin', rights: 'root'}
let merge = Object.assign({}, user, admin)
console.log(merge)
// {name 'admin', password: 'user', rights: 'root'}
merge = {...user, ...admin}
console.log(merge)
// {name 'admin', password: 'user', rights: 'root'}