题目描述去掉对象数组中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}
];
添加回答
举报
0/150
提交
取消