function compareCreationDate(channel1, channel2) {
    if (channel1.createdOn < channel2.createdOn) {
      return 1;
    }
    if (channel1.createdOn > channel2.createdOn) {
      return -1;
    }
    // channel 1 must be equal to channel 2
    return 0;
  }
/* New: Definition of compare function to compare (sort in descending order) channels according to creation Date of channel */
Definition of compare function to compare (sort in descending order) channels according to creation Date of channel
Definition of compare function to compare ( sort in descending order ) channels according to creation Date of channel
function compareCreationDate(channel1, channel2) {
    if (channel1.createdOn < channel2.createdOn) {
      return 1;
    }
    if (channel1.createdOn > channel2.createdOn) {
      return -1;
    }
    return 0;
  }
function compareCreationDate ( channel1 , channel2 ) { if ( channel1 . createdOn < channel2 . createdOn ) { return 1 ; } if ( channel1 . createdOn > channel2 . createdOn ) { return - 1 ; } return 0 ; }
New: Definition of compare function to compare (sort in descending order) channels according to creation Date of channel
New : Definition of compare function to compare ( sort in descending order ) channels according to creation Date of channel
// channel 1 must be equal to channel 2