I have 2 objects
{
"Simon": {
"occupation": "garbage man",
"age": "21"
}
}
and this one
{
"wife": "Kate"
}
How will I insert the second object to the first object to result as
{
"Simon": {
"occupation": "garbage man",
"age": "21",
"wife": "Kate"
}
}
And also can be applied even when wife exists:
{
"wife": "Shandia"
}
Results to
{
"Simon": {
"occupation": "garbage man",
"age": "21",
"wife": "Shandia"
}
}
Is there a way to achieve this using lodash?
Object.assign