Lodash remove duplicates from array

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

This is my data:

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


        
7条回答
  •  醉梦人生
    2020-11-29 17:32

    For a simple array, you have the union approach, but you can also use :

    _.uniq([2, 1, 2]);
    

提交回复
热议问题