I have a nested object:
{
id: 240,
name: 'FY1 2022',
children: [
{
id: 241,
name: 'Q1 2022',
children: [
{
id: 242,
name: 'Jan 2022',
},
{
id: 243,
name: 'Feb 2022',
},
{
id: 244,
name: 'Mar 2022',
},
],
},
],
};
and I need to get all the id values into an array from that objects that does not have the property children.
Is there a way to do this?
Thanks in advance!