const a = {
fruits: ['apple', 'banana'],
series: {
apple: ['C'],
banana: ['A', 'B'],
}
};
const b = {
fruits: ['banana', 'orange'],
animals: ['pig'],
series: {
banana: ['B', 'C'],
orange: ['A'],
}
}
const merge = (a, b) => {
//...
}
// 期望输出:
{
fruits: ['apple', 'banana', 'orange'],
animals: ['pig'],
series: {
apple: ['C'],
banana: ['A', 'B', 'C'],
orange: ['A'],
}
}