I have two JSON objects:
result:{
name:ABC
}
and
result:{
city:PQR
}
I want to merge both and get output as following:
result:{
name:ABC,
city:PQR
}
I have two JSON objects:
result:{
name:ABC
}
and
result:{
city:PQR
}
I want to merge both and get output as following:
result:{
name:ABC,
city:PQR
}
Use this:
var obj1 = { name:ABC }
var obj2 = { city:PQR }
const merged = Object.assign({}, obj1, obj2);