Excerpt | ||
---|---|---|
| ||
orderList(list, order) Return a new list containing the contents of a supplied list, sorted. |
Function: orderList()
Return a new list containing the contents of a supplied list, sorted.
...
Argument | Type | Description |
---|---|---|
list | Array | The list to be sorted |
order | String | If this is 'ASC', sort in ascending order. If this is 'DESC', sort in descending order. If this parameter is omitted, sort in ascending order |
Examples
orderList([1,4,3,2])
Returns [1,2,3,4].
orderList(['a','z','b'], 'DESC')
Returns ['z','b','a'].