Answers for "sort array ascending based on value typescript"

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);
Posted by: Guest on August-20-2020
0

typescript sort number array descending

values.sort((one, two) => (one > two ? -1 : 1));
Posted by: Guest on February-24-2021

Code answers related to "sort array ascending based on value typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language