This is my data:
(这是我的数据:)
[
{
url: 'www.example.com/hello',
id: "22"
},
{
url: 'www.example.com/hello',
id: "22"
},
{
url: 'www.example.com/hello-how-are-you',
id: "23"
},
{
url: 'www.example.com/i-like-cats',
id: "24"
},
{
url: 'www.example.com/i-like-pie',
id: "25"
}
]
With Lodash, how could I remove objects with duplicate id keys?
(使用Lodash,如何删除具有重复ID键的对象?)
Something with filter, map and unique, but not quite sure.(带有过滤器,地图和独特内容的东西,但不是很确定。)
My real data set is much larger and has more keys, but the concept should be the same.
(我的真实数据集更大,并且具有更多的键,但是概念应该相同。)
ask by ChrisRich translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…