Say i have two objects, object_one
{
1: {item1 /*updated*/}, //note updated represents more recent item1 data
2: {item1 /*updated*/},
3: {item1 /*updated*/}
}
and object_two
{
1: {item1, item2, item3},
2: {item1, item2, item3},
4: {item1, item2, item3},
5: {item1, item2, item3}
}
I want to add the object_one into the object_two, adding any elements that the object_two doesn't have. I also want to take the object_two's versions of item1 and update them to the value of object_one's
Desired result
{
1: {item1 /*updated*/, item2, item3},
2: {item1 /*updated*/, item2, item3},
3: {item1 /*updated*/},
4: {item1, item2, item3},
5: {item1, item2, item3}
}
I've tried doing it myself, but my solution was manual and didn't work for all lengths of object_one and object_two. Some direction would be much appreciated
item1(updated)resolve to? Is that a function?item1(updated)===item1soitem1(updated)don't need to update?because they both have stringitem1?