Write a sorting function that takes in an array of names and sorts them by last name alphabetically javascript code example
Example: sort function explained javascript
var sortedArray = myArray.sort(function(a,b){
if (a.name < b.name)
return -1;
else if (a.name == b.name)
return 0;
else
return 1;
});