So, i have an object, for example
let header = {
"navbar": {
"buttons": {
0: {
"content": "home",
"color": "blue",
"href": "home"
},
1: {
"content": "shop",
"color": "red",
"href": "shop"
},
2: {
"content": "contact",
"color": "gold",
"href": "contact"
}
}
}
};
And i have a second object:
let header = {
"navbar": {
"buttons": {
0: {
"content": "work",
},
2: {
"color": "blue",
"href": "test"
}
}
}
};
Now i want to update the first object keys that exist in the second object. So the object looks like this:
let header = {
"navbar": {
"buttons": {
0: {
"content": "work",
"color": "blue",
"href": "home"
},
1: {
"content": "shop",
"color": "red",
"href": "shop"
},
2: {
"content": "contact",
"color": "blue",
"href": "test"
}
}
}
};
What is the easiest way of aproaching this problem? Thanks in advance, Jari