I have an array of object like this:
example = [
{
id: 1,
child: [
{
id: 1,
name: "child 1",
},
],
},
{
id: 2,
child: [
{
id: 2,
name: "child 2",
},
{
id: 3,
name: "child 3",
},
],
},
];
and I want to get an array of child objects like this:
[{...},{...},{...}]
I tired to loop through with map but I'm getting an array of two object.