Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 2x 4x 4x 4x 4x 2x 2x 2x 4x 2x 2x 2x | const sortByAlphabet = (a, b) => {
const title1 = a;
const title2 = b;
let comparison = 0;
if (title1 > title2) {
comparison = 1;
} else if (title1 < title2) {
comparison = -1;
}
return comparison;
};
const sortByDate = (a, b) => {
{
return new Date(b).getTime() - new Date(a).getTime();
}
};
export { sortByAlphabet, sortByDate };
|