去掉对象数组中key值相同的对象
let arr = [ {"weight":10,"id":1}, {"weight":20,"id":2}, {"weight":30,"id":2}, {"weight":40,"id":4}, {"weight":50,"id":5} ];
let arr = [ {"weight":10,"id":1}, {"weight":30,"id":2}, {"weight":40,"id":4}, {"weight":50,"id":5} ];
关注 | 4
收藏
评论
邀请回答
相关分类