ts ordered list code example
Example 1: how to sort numbers in typescript
var numericArray: number[] = [2, 3, 4, 1, 5, 8, 11];
var sortedArray: number[] = numericArray.sort((n1,n2) => n1 - n2);
Example 2: string sort javascript
var names = ["Peter", "Emma", "Jack", "Mia"];
var sorted = names.sort(); // ["Emma", "Jack", "Mia", "Peter"]