标签: javascript arrays underscore.js
我想删除数组中的所有重复对象。但它不起作用
var a = [{name: 'user-test'}, {6: 7}, {6: 7}, {name: 'user-test'}]; _.uniq(a);
返回:[{name: 'user-test'}, {6: 7}, {6: 7}, {name: 'user-test'}] 预期:[{name: 'user-test'}, {6: 7}]
[{name: 'user-test'}, {6: 7}, {6: 7}, {name: 'user-test'}]
[{name: 'user-test'}, {6: 7}]
有人能给我一个答案吗?