1var numericArray: number[] = [2, 3, 4, 1, 5, 8, 11];
2
3var sortedArray: number[] = numericArray.sort((n1,n2) => n1 - n2);
1var stringArray: string[] = ['AB', 'Z', 'A', 'AC'];
2
3var sortedArray: string[] = stringArray.sort((n1,n2) => {
4 if (n1 > n2) {
5 return 1;
6 }
7
8 if (n1 < n2) {
9 return -1;
10 }
11
12 return 0;
13});