const people = ['eck,Glenn', 'Becker, Carl', 'aeckett, Samuel', 'Beddoes, Mick', 'Beecher, Henry', 'Beethoven, Ludwig', 'Begin, Menackem', 'Belloc, Hilaire']
const alpha = people.sort((lastOne, nextOne) => {
const [aFirst, aLast] = lastOne.split(", ");
const [bFirst, bLast] = nextOne.split(", ");
return aLast > bLast ? 1 : -1;
})
效果