0
I have the following function to sort, but, does not correctly sort the accented words
ordenaNomeCompleto: function(a,b){
var ans = 0;
if(a.nome_completo < b.nome_completo) ans = -1
if(a.nome_completo > b.nome_completo) ans = 1
return ans;
},
Searching the Internet I found this method:
ans = a.localeCompare(b)
but, there is the following message on the console
a.localeCompare is not a function
Rent has a tip to solve this problem with pure javascript?
a
is a string?– reisdev
Shouldn’t use
a.nome_completo.localComparte(b.nome_completo)
? For they are the strings that should be compared– reisdev