Is there a way to merge object keys' values from JSON arrays based on their key?
json1 = [
{key:'xyz', value:['a','b']},
{key:'pqrs', value:['x','y']}
]
json2 = [
{key:'xyz', value:['c','b']},
{key:'pqrs', value:['e','f']}
]
I am looking for a solution in JavaScript to combine the object keys' values as shown below
json3 = [
{key:'xyz', value:['a','b','c']},
{key:'pqrs', value:['x','y','e','f']}
]
Essentially, I want to merge unique values of objects from JSON arrays by their key.