I have an Object a like that:
a
const a = { user: { … groups: […] … } }
whereby there are a lot more properties in
You can change it this way,
const b = Object.assign({}, a, { user: Object.assign({}, a.user, { groups: {} }) });