Anyone know how to recursively find and delete an object from an array structured like this with infinite nested objects with the same structure?
[
{
id: 1,
nest: [
{
id: 2,
nest: [{id: 3, nest: [{..continues..}]}],
},
{
id: 4,
nest...
Context: I have a form where a user enters in data. I want to remove all object elements in the phone array that contain an empty string in the phoneNumber property.
Here is example data:
const data =
[
{
contactName: "Contact 1 Name",
phone: [
{phoneName: "Some Name"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.