Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

举个例子子:
`

data = [
    {
        id:1,
        name: 'a',
        group: [
            {
                label: 111
                id:222
            },
            {
            label: 111
            id:3333
            },
            {
                ids:[
                    {
                        id:'这是要查找的深层目标'
                    }
                ]
            }
        ]
    }
]

`

就类似与上面这种非常非常复杂的结构,有没有直接点的方法比如说:

_.(data, id => id == '这是要查找的深层目标') 然后直接返回如下:

{id: '这是要查找的深层目标'}.

如果没有,有什么思路给他加一个,要不然 多次遍历太复杂了,新手求教大佬


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...