I'm looking to flatten the given data structure using Javascript Array methods:
accounts: [
{
id: 129,
contacts: [932, 552, 803]
},
{
id: 433,
contacts: [932, 606]
}
]
So that it becomes:
[932, 552, 803, 606]
Have any ideas on how to achieve this while keeping the contacts unique?