猿问

合并相同数据

var data = [{"menu":47,"children":[56]},{"menu":47,"children":[55]},{"menu":48,"children":[59]},{"menu":48,"children":[58]}]
遍历data找出相同menu在合并children,得到下面数据结构
[{"menu":47,"children":[55,56]},{"menu":48,"children":[58,59]}]

浮云间
浏览 478回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答