- Let's say you have 2 dynamic dictionaries.
- Both dictionaries will always be the same length.
- And both dictionaries will always share a matching "ID".
- There are an unknown amount of entries in each dictionary. (e.g. both could have 4 entries, or both could have 20 entries)
for instance:
var dict1 = {};
var dict2 = {};
dict1.id = "3";
dict1.val1 = "4";
dict2.id = "3";
dict2.val2 = "6";
How can you merge both into 1 "final" dictionary, where they are merged at the id?
var main = {};
main.id = "3";
main.val1 = "4";
main.val2 = "6";