What is a fast way of mapping data like the data below using lodash into a single array of level2 objects.
SomeObject = {
name: 'someObject',
level1: [
{
id: '1',
level2: [
{ someValue: 'example1'},
{ someValue: 'example2'},
{ someValue: 'example3'},
{ someValue: 'example4'}
]
},
{
id: '2',
level2: [
{ someValue: 'example5' },
{ someValue: 'example6' },
{ someValue: 'example7' },
{ someValue: 'example8' }
]
},
{
id: 'n',
level2: [
{ someValue: 'examplen' },
]
}
]
}
output:
[
'example1',
'example2',
'example3',
'example4',
'example5',
'example6',
'example7',
'example8',
'examplen',
]
ignore: Stackflow is smarter than I so I have to type more non code stuff for it to stop complaining. So I'll type more so that I may post.