I have an object array looking like this:
[
{
"number": 1,
"salary": 2000,
"premium": 200,
"taxes": 500,
"friends": [
{
"number": 1,
"salary": 10,
"premium": 10,
"taxes": 50,
"parents": [
{
"number": 1,
"salary": 4,
"premium": 10,
"taxes": 50,
"cars": [{ "car": 1, "bike": "fast" }]
},
{
"number": 2,
"salary": 4,
"premium": 10,
"taxes": 50,
"cars": [{ "car": 1, "bike": "fast" }]
},
]
}
]
}
]
How can I get the arrays out of that object? The main array might contain more objects of that kind in the future. The arrays will always have the same key, e.g. friends, parents etc.
I tried map and flat functions, but I don't really get the result I need.
Would be great if someone could help.