Showing posts from June, 2020

Sorting in Typescript (Simple Arrays & Array of Objects)

Hi Friends, This post is not regarding the SharePoint but it is a very common functionality that we need in day to day coding. So I thought to write down here. This functionality is of sorting in Typescript. Sorting simple Arrays Sorting is the very basic functionality that is required and when it comes to typescript  we do get OOB method, but that is for the simple array.    let  fruits : string []  =  [ ' Banana ' ,  ' Orange ' ,  ' Apple ' ,  ' Pineapple ' ] ;    console . log (fruits. sort ()); Output : Apple, Banana, Orange, Pineapple Sorting an Array of Objects When it comes to sorting the array of objects, we do not have any OOB method which can serve our purpose. for this, we have to write our small custom logic within the sort method let  fruits :   any []  =  [{ Name :   ' Banana '  }, { Name :   ' Orange '  },  { Name :   ' Apple '  }, { Name :   ' Pineapple '  }];    console . log (frui

Know your SharePoint Framework (SPFx) version

Hi Friends, Most of the time when we are working on the SharePoint Framework or SPFx solutions, the version of each component can create issues while building the solutions. One of the common issues is with the SPFx version. SPFx version is the version of the SharePoint Framework yeomen generator installed on your machine. With the difference in the version, a solution might differ in the import versions of other libraries, change in solution scaffolding, and more... ➡️Steps to know your SPFx version Open the console  Type in the following command  npm ls -g --depth=0 @microsoft/generator-sharepoint Hit enter and wait for a few seconds. You'll get the response   Happy Coding #Microsoft #SharePoint #SharePointWidgets