First steps in Typescript Array Sorting
Like many other languages, Typescript offers a built in Array sort() method. However, most of the times we have to use and pass our own comparison function. This is the case, especially when we have to order arrays of objects, and ordering should be based on specific object property. Moreover, we have also to take into account the default mutability of arrays, if we have to preserve the initial arrangement of the elements in an array.