I'm trying to make a sorting system. The problem I am facing is that the 'aa' comes last because in Danish 'aa' means 'å' and that is why it is last. If it is possible I want the 'aa' to be first and not last in the list.
So to simplify, this is the output it gives me:
data
æ
ø
å
aa
...and the order I want is:
aa
data
æ
ø
å
Here is the code I am working on
var list = ["data", "aa", "å", "æ", "ø"];
const collator = new Intl.Collator("da", { caseFirst: "lower" });
document.write(list.sort(collator.compare));
EDIT: By switching to Icelandic instead of Danish, it seems to work on phones but not on computers.
EDIT2: On computers, it seems like Google Chrome and Microsoft Edge (Chromium) is not currently working, however Microsoft Edge (EdgeHTML), Mozilla Firefox and Safari are working. Internet Explorer just gets weird.
var list = ["data", "aa", "å", "æ", "ø"];
const collator = new Intl.Collator("is", { caseFirst: "lower" });
document.write(list.sort(collator.compare));