I have 2 two level JavaScript structures, which I need to merge. What would be the easiest way?
var object1={
"section1": {
"prop1": 0,
"prop2": 0
},
"section2": {
"something": 0,
"other": 0
}
}
var object2={
"section1": {
"prop1": 1
}
}
object2 contains changes made in the UI by user and I need to get the merged object, showing all the data, with only those properties present in object2 overwritten by object2's values.