to all! I have the following data:
const datas = [
{
first: 'id',
secondLevel: [
{
second: 'id2',
thirdLevel: ['a', 'b', 'c']
},
...
]
...
}
...
]
My goal is to create all possible associations with the data of the 3 levels
for example
[
{
first: 'id',
second: 'id2',
third: 'a'
},
{
first: 'id',
second: 'id2',
third: 'b'
},
...
]
I'm currently doing it with a foreach in a foreach in a foreach and it's horrible I'm sure I can do it really better.
Somebody can help me ? Thanks !