Answers for "typescript sort"

5

sort array of objects javascript

list.sort((a, b) => (a.color > b.color) ? 1 : -1)
Posted by: Guest on July-23-2020
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

Code answers related to "typescript sort"

Code answers related to "Javascript"

Browse Popular Code Answers by Language