删除嵌套数组中的某一项 财富值16

2016-10-18 14:35发布

[{         "title": "parent",         "expanded": true,         "folder": true,         "id": "0",         "children": [           {             "title": "parent[0]",             "expanded": true,             "folder": true,             "id": "1",             "children": [               {"title": "Books",  "id": "2"},               {"title": "Kindle Books",  "id": "3"},               {"title": "Books For Study",  "id": "4"},               {"title": "Audiobooks",  "id":"5"}             ]           },           {             "title": "parent[1]", "id": "6", "folder": true, "children": [             {"title": "Music", "id": "7"},             {"title": "MP3 Downloads", "id": "8"},             {"title": "Musical Instruments & DJ", "id": "9"},             ]           }         ]       }]

想根据id来删除数组中的某一项,数组长度不确定,是嵌套的,知道用递归。。但是不会写,哪位能帮忙写下。。

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
3条回答

}];

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">

</script>
</body>
</html>

一周热门 更多>