Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

immutable js sort ascending and descending order

var sorted = data.get('item').sortBy((item) => -item.get('sequence'));
// or var sorted = data.get('item').sortBy((item) => item.get('sequence')).reverse();
// you can now use .map() to go through your OrderedMap which has been
// sortbed by the sequence property and would look like your desired output
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #immutable #js #sort #ascending #descending #order
ADD COMMENT
Topic
Name
3+7 =