How to access nested array of all elements of an array in ES6? Eg
source = [
{
id: '1',
list: ['a1','a2','a3']
},
{
id: '2',
list: ['b1','b2']
}
]
i want an output ['a1','a2','a3','b1','b2]
i'm doing this but its returning array with length 1, 0th element ['a1','a2','a3','b1','b2]
.
source.map(x=>x.list).map(x=>x);