var arr = [
{"name" : "1","value" : "qqq","age" : "10"},
{"name" : "1","value" : "qqq","age" : "10"},
{"name" : "2","value" : "eee","age" : "20"},
{"name" : "4","value" : "rrr","age" : "50"},
{"name" : "5","value" : "ttt","age" : "100"}
];
除去重復數據,name value age 三個值均相等為重復數據,求大神幫忙
var arr = [
{ "name": "1", "value": "qqq", "age": "10" },
{ "name": "1", "value": "qqq", "age": "10" },
{ "name": "1", "value": "qqq", "age": "10" },
{ "name": "2", "value": "eee", "age": "20" },
{ "name": "4", "value": "rrr", "age": "50" },
{ "name": "5", "value": "ttt", "age": "100" }
];
for (var i = 0; i < arr.length; i++) {
for (var j =i+1; j <arr.length; ) {
if (arr[i].name == arr[j].name && arr[i].value == arr[j].value && arr[i].age == arr[j].age) {
arr.splice(j, 1);
}
else j++;
}
}
console.log(arr)