I have an array of strings like
let array = ['Enflure', 'Énorme', 'Zimbabwe', 'Éthiopie', 'Mongolie']
I want to sort it alphabetically, so I use array.sort()and the result is:
['Enflure', 'Mongolie', 'Zimbabwe', 'Énorme', 'Éthiopie']
I think the emphasis here is the problem, so I would like to replace it with Éthe Ewhole array.
I tried this
for (var i = 0; i < (array.length); i++) {
array[i].replace(/É/g, "E");
}
But that did not work. How can i do this?
source
share