Using JavaScript how can I recursively remove objects from an array and add those items to a new array?
I have an array of nested objects: const members = [ { name: 'Mike', type: 'MANAGER', children: [] }, { name: 'John', type: 'MANAGER', children: [ { name: 'George', type: 'EMPLOYEE', children: [] }, { name: 'Jake', type: 'EMPLOYEE', children:…