Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.reportComparisons
- .sort((a, b) => {
- let result;
- if (!a.isValid) {
- result = isAscending ? 1 : -1;
- } else if (!b.isValid) {
- result = isAscending ? -1 : 1;
- } else {
- const aAppName = a.appName.toLowerCase();
- const bAppName = b.appName.toLowerCase();
- result = aAppName < bAppName ? 1 : -1;
- if (isAscending) {
- result *= -1;
- }
- }
- return result;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement