Files
bodyshop/client/src/utils/sorters.js

15 lines
291 B
JavaScript

export function alphaSort(a, b) {
let A;
let B;
A = a ? a.toLowerCase() : "";
B = b ? b.toLowerCase() : "";
return A.localeCompare(B);
// if (A < B)
// //sort string ascending
// return -1;
// if (A > B) return 1;
// return 0; //default return value (no sorting)
}