//去除数组中重复的属性值 var unique = {}; $scope.my_students.forEach(function(gpa) { unique[JSON.stringify(gpa)] = gpa }); $scope.my_students = Object.keys(unique).map(function(u) { return JSON.parse(u) }); console.log("我的学生"); console.log(unique);
转载于:https://my.oschina.net/lccchn/blog/2054778