怎么对素组进行有条件去重复?
[
{name:小红,score:97},
{name:小红,score:98}
{name:小明,score:89}
]
用什么函数方法能只保留同名里分数最高的记录,
也就是得到这个:[{name:小红,score:98},{name:小明,score:89}]
[
{name:小红,score:97},
{name:小红,score:98}
{name:小明,score:89}
]
用什么函数方法能只保留同名里分数最高的记录,
也就是得到这个:[{name:小红,score:98},{name:小明,score:89}]