File size: 214 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export const ascending = ( a, b ) => {
  if( a < b ){
    return -1;
  } else if( a > b ){
    return 1;
  } else {
    return 0;
  }
};

export const descending = ( a, b ) => {
  return -1 * ascending( a, b );
};