Sortir array berdasarkan javascript alfabet
users.sort((a, b) => a.firstname.localeCompare(b.firstname))
Blue-eyed Buzzard
users.sort((a, b) => a.firstname.localeCompare(b.firstname))
var items = ['réservé', 'premier', 'communiqué', 'café', 'adieu', 'éclair'];
items.sort((a, b) =>
a.localeCompare(b)//using String.prototype.localCompare()
);
//sort array alphabetically
objArray.sort(function(a, b) {
return a.localeCompare(b);
});