equal_points = {18:[
{'scored_goals':500,'lost_goals': 520,'team':'team A'},
{'scored_goals':490,'lost_goals': 530,'team':'team B'},
{'scored_goals':500,'lost_goals': 510,'team':'team C'},
{'scored_goals':490,'lost_goals': 500,'team':'team D'}
]};
var tmp_scored = [];
angular.forEach(equal_points, function(item) {
angular.forEach(item, function(team) {
tmp_scored.push(team.scored_goals);
console.log(tmp_scored);
});
});
Hi,I would like sort object by scored but if they are equal then sort them by lost goals.How can I check which objects have the same values?