Monday, July 31, 2017

sorting collections in TypeScript

whatever = whatever.sort((yin, yang) => {
   if (yin.label > yang.label){
      return 1;
   }
   if (yin.label < yang.label){
      return -1;
   }
   return 0;
});

No comments:

Post a Comment