Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sort() object values javascript

list.sort((a, b) => (a.color > b.color) ? 1 : (a.color === b.color) ? ((a.size > b.size) ? 1 : -1) : -1 )
Source by flaviocopes.com #
 
PREVIOUS NEXT
Tagged: #object #values #javascript
ADD COMMENT
Topic
Name
5+5 =