Tri de tableau par javascript alphabétique
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);
});