how to combine 2 objects in javascript code example
Example 1: merge two objects javascript
const object1 = {
name: 'Flavio'
}
const object2 = {
age: 35
}
const object3 = {...object1, ...object2 }
Example 2: javascript merge objects
var person={"name":"Billy","age":34};
var clothing={"shoes":"nike","shirt":"long sleeve"};
var personWithClothes= Object.assign(person, clothing);
Example 3: react merge two objects
const object1 = {
name: 'Flavio'
}
const object2 = {
age: 35
}
const object3 = {...object1, ...object2 }