If have an array like this
var tab = ['1185 Design','3 D Exhibits','44Doors', '4Concepts','ABC Data','acceleration'];
I want to sort it so that small letter 'a' element comes before capital letter 'A' element. Thanks.
If have an array like this
var tab = ['1185 Design','3 D Exhibits','44Doors', '4Concepts','ABC Data','acceleration'];
I want to sort it so that small letter 'a' element comes before capital letter 'A' element. Thanks.
Your array :
var tab = ["Animal","123", "animal"]
Sort function :
tab.sort(function(a,b){return a.localeCompare(b); })
OUTPUT :
["123", "animal", "Animal"]