Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sorting json array by key in angular 9

list.sort((a, b) => (a.color > b.color) ? 1 : (a.color === b.color) ? ((a.size > b.size) ? 1 : -1) : -1 )
 
PREVIOUS NEXT
Tagged: #sorting #json #array #key #angular
ADD COMMENT
Topic
Name
7+4 =