我有两个json对象obj1和obj2,我想合并它们并克里特一个json对象.结果json应该具有来自obj2的所有值和来自obj1的值,这些值在obj2中不存在.
Question:
var obj1 = {
"name":"manu",
"age":23,
"occupation":"SE"
}
var obj2 = {
"name":"manu",
"age":23,
"country":"india"
}
Expected:
var result = {
"name":"manu",
"age":23,
"occupation":"SE",
"country":"india"
}
Run Code Online (Sandbox Code Playgroud)