I have an array of objects and I was wondering if you could sort the array by an attribute in the object? Here is a sample of what I mean:
for (var i = 0; i < response.data.length; i++) {
person[i] = {
"name":response.data[i].name,
"phone":response.data[i].phone
};
person[i].name.sort();
}
I'm trying to sort the array by the objects name.