How to sort special letters (typescript)?
问题 I want to sort some letters in ts... sort method and localCompare() sort in this way Ä, Å, Ö, instead of Å, Ä, Ö. How to sort any letters corectly? I have a list of objects: class MyObj { id:number, name: string, type:number } I tried var list: MyObj[] = a list of objects list.sort(function (a, b) { return a.name.toUpperCase().localeCompare(b.name.toUpperCase()); }); UPDATE Yes, georg answer was correct: I found this too: var strings = ["Ålex", "Ålex3", "Älex2"]; var sorter = new Intl