📜  localecompare javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:07.499000             🧑  作者: Mango

代码示例1
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