To use this function add it to the class library file named Utilities.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: Utilities.ts
Function sortArrayOfNumber
Description: Orchestrator Function to Sort an Array of Numbers
public static sortArrayOfNumber(arr: number[], enumSortOrder: SortOrder = SortOrder.Forward): number[] {
arr.sort((intA: number, intB: number): 1 | -1 | 0 => {
return Utilities.compareTwoNumbers(intA, intB, enumSortOrder);
});
return arr;
}Enumeration: SortOrder
export enum SortOrder {
Forward = "Forward",
Reverse = "Reverse"
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
