const arr = [{title: 'test', id: 1, children: []}, {title: 'test1', id: 2, children: [{title: 'first children', id: 3}]}][{title: 'test', id: 1, children: []}, {title: 'test1', id: 2, children: []}]
const arr = [{title: 'test', id: 1, children: []}, {title: 'test1', id: 2, children: [{title: 'first children', id: 3}]}]
arr.splice(arr.indexOf(arr.find(el => el.id === id)),1);[{title: 'test', id: 1, children: []}][{title: 'test', id: 1, children: []}, {title: 'test1', id: 2, children: []}]
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 = [];
})