Question: i've got array like this. Unlimited number of nesting possible

```
const myArray = [
  {
   id: 1, 
   children: [
              { 
                id: 3,
                children: []
              }
             ]
  },
  {
   id: 2, children: []
  }
]

```

Please, help me to remove any object by id and return new array without it.

Answer: 
Using array methods and recursive function:

```js
function fn(arr, id) {
  return arr
    .filter((el) => el.id !== id)
    .map((el) => {
      if (!el.children || !Array.isArray(el.children)) return el;
      el.children = fn(el.children, id);
      return el;
    });
}

const myArray = [
  {
    id: 1,
    children: [
      {
        id: 3,
        children: [],
      },
    ],
  },
  {
    id: 2,
    children: [],
  },
];

console.log(fn(myArray,1))
console.log(fn(myArray,2))
console.log(fn(myArray,3))
```
Ah, homework problems.

* write 'kill\_entries\_with\_id(child\_array, id\_to\_kill)'. For each element of the child array, it should `del` the element if its id matches. Otherwise, it should recursively call itself with the element's children.
* Note that you should walk the array backwards by index so you don't have to worry about deleting elements mucking up your loop. Consider `list(range(10,-1,-1)`