let arr = [{
role: "admin",
left: "fzz",
children: [{
role: "other",
right: "pdd",
children: [{
role: "admin"
}]
}]
}]
how does a data format like this return an array recursively, leaving the data format unchanged, but taking out the role as admin? (including data in children should also be filtered for role.) if the parent role is not admin, both that level and its children will be discarded
return:
arr = [{
role: "admin",
left: "fzz",
children: [{
role: "admin",
right: "pdd"
}]
}]