const user = {
name: 'John Deo',
gender: 'Male'
};
const role = {
admin: '1'
};
const details = {
email: '[email protected]',
city: 'New York',
};
const final_object = { ...user, ...role, ...details };
console.log(final_object);
We have three objects user, role, details and we want to make a final object from these three object. We are assigning the combination of these objects to final_object constant.
0 Comments