OpenWGA 7.11 - TMLScript reference
WGA » WGA.List()Method :
sortList([function])
On object | WGA.List() |
Usage |
Sorts the list elements according to a custom compare function. |
Description |
The function parameter is optional. If not specified the elements will be sorted by "natural oder" if possible (like numbers) or converted to strings and sorted alphabetically. The function is called with a pair of values to be compared and should return -1, 0 or 1. |
Parameters |
function (optional) JavaScrpt function to compare value pairs. |
Return value |
WGAList object with new values. |
Allowed in script types |
|
Examples |
WGA.List([1, 3, 2]).sortList() //returns [1,2,3] |