【发布时间】:2021-12-20 20:56:28
【问题描述】:
如何从根目录中删除重复项。基本上我想查看 UUID 属性的完整数组。如果在数组中的其他任何位置找到来自数组根的 UUID,我想从根中删除该对象。
示例:“UUID”:“9E741BEC-7BC1-49C0-8214-AB5A65762CB7”位于树的顶层。它也在其中一个孩子身上发现。所以我想删除顶层的on
{
"UUID": "9E741BEC-7BC1-49C0-8214-AB5A65762CB7",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Frances Stowe Great lesson ????"
},
{
"UUID": "9E741BEC-7BC",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Nice to know,
"Children": [{
"UUID": "9E741BEC-7BC1-49C0-8214-AB5A65762CB7",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Frances Stowe Great lesson ????",
"Children": [{
"UUID": "9E741",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Frances Stowe Great lesson ????"
}],
}],
},
{
"UUID": "9E741BEC-7BC",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Nice to know
},
},
我想要的输出如下
{
"UUID": "9E741BEC-7BC",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Nice to know,
"Children": [{
"UUID": "9E741BEC-7BC1-49C0-8214-AB5A65762CB7",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Frances Stowe Great lesson ????",
"Children": [{
"UUID": "9E741",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Frances Stowe Great lesson ????"
}],
}],
},
{
"UUID": "9E741BEC-7BC",
"Visible": false,
"WasVisibleTransient": false,
"WhichCorners": 15,
"Width": 796.5216064453125,
"Width2": 796.5216064453125,
"Width3": 796.5216064453125,
"title": "Nice to know
},
},
【问题讨论】:
标签: javascript arrays filter