Let's say I have an array like so...
const myCustomers = [
{
accounts: [
{
accountID: 1234
},
{
acountID: 2345
}
]
},
{
accounts: [
{
accountID: 3456
}
]
},
{
accounts: [
{
accountID: 4567
},
{
accountID: 5678
}
]
}
];
I'm basically just trying to create an array of all the accountIDs, so it looks something like this...
const accountIDs = [1234, 2345, 3456, 4567, 5678];
I've tried using map but I'm not having luck.
const myRes = myCustomers.map(a => a.accounts.accountID);