Home > shorts > Merge two objects in JavaScript
Merge two objects in JavaScript
Merge two objects in JavaScript
Spread operator is the perfect way to merge two simple objects into one.
const obj1 = { name: "short_dev_tips" }
const obj2 = { platform: "instagram" }
const obj3 = {...obj1, ...obj2}
{
name: "short_dev_tips",
platform: "instagram"
}