sortBy()
Sorts an array of objects by one or more properties.
Each entry in sortProperties is a string in the format 'property:order'
where order is 'asc' or 'desc'. Supports dot-notation for nested properties.
Kind: global function
Returns: Array.<Object> - A new sorted array.
| Param | Type | Description |
|---|---|---|
| objects | Array.<Object> | The array to sort. |
| sortProperties | Array.<string> | Sort descriptors in 'property:order' format. |
Example
ARM.sortBy(addresses, ['attributes.city:asc', 'id:desc'])Last updated on