i am working on Angular7 and Typescript, i want to sort array of dict in typescript. here is my data :
{
"data": [
{
"name": "Azad University",
"tedad": 80
},
{
"name": "University of Science and Technology",
"tedad": 14
},
{
"name": "University of Kurdistan",
"tedad": 30
}
]
}
i want to sort this data by tedad key. how can i do this?
i see this code on stackoverflow but i dont know how to change it that works:
items.sort(function(first, second) {
return second[1] - first[1];
});