ts sort array by number 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: javascript sort
homes.sort(function(a, b) {
return parseFloat(a.price) - parseFloat(b.price);
});