const arr = [{title: 'test', id: 1, children: []}, {title: 'test1', id: 2, children: [{title: 'first children', id: 3}]}]
arr.map((item, index) => {
item.children.map((ch_item, ch_index) => {
if (ch_item.id === 3) item.children = [];
})
})
item.children.map((ch_item, ch_index) => {
if (ch_item.id === 3) item.children = [];
})
если нашли: