How do i make this alpha sort not case sensitive? I understand that you should use to toLowerCase but I don't know how.
sort_alpha: function(a,b) {
if (a[0]==b[0]) return 0;
if (a[0]<b[0]) return -1;
return 1;
}
How do i make this alpha sort not case sensitive? I understand that you should use to toLowerCase but I don't know how.
sort_alpha: function(a,b) {
if (a[0]==b[0]) return 0;
if (a[0]<b[0]) return -1;
return 1;
}
You need to turn a and b into lower case
var lower_a = a.toLowerCase();
var lower_b = b.toLowerCase();