const a = 'réservé'; // with accents, lowercase
const b = 'RESERVE'; // no accents, uppercase
console.log(a.localeCompare(b));
// expected output: 1
console.log(a.localeCompare(b, 'en', {sensitivity: 'base'}));
// expected output: 0
let items = ['réservé', 'Premier', 'Cliché', 'communiqué', 'café', 'Adieu']
// ['Adieu', 'café', 'Cliché', 'communiqué', 'Premier', 'réservé']
console.log(items.sort( (a, b) => a.localeCompare(b, 'fr', {ignorePunctuation: true})));
so sanh string