Lodash remove duplicates from array

后端 未结 7 689
慢半拍i
慢半拍i 2020-11-29 17:12

This is my data:

[
    {
        url: \'www.example.com/hello\',
        id: \"22\"    
    },
    {
        u         


        
7条回答
  •  情歌与酒
    2020-11-29 17:35

    You can also use unionBy for 4.0.0 and later, as follows: let uniques = _.unionBy(data, 'id')

提交回复
热议问题