为了账号安全,请及时绑定邮箱和手机立即绑定

JavaScript 去掉对象数组中key值相同的对象

JavaScript 去掉对象数组中key值相同的对象

开满天机 2018-10-24 19:12:02
题目描述去掉对象数组中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收藏 评论邀请回答
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 609 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信