sort

sort ( list list , bool[default:true] ascending , bool byKey ) : void

Sort a list
Returns the sorted list (note that the origine list is sorted too and is the same than the return, the list is taken by reference).

Example

list=[2,8,6,3]
sort(list)
//-> [2,3,6,8]

tab=[3.8,"2",1,2.0]
console(sort(tab))
//-> [1, "2", 2.0, 3.8]

Parameters

list

The list to sort

ascending

true=ascending order, false=ascending order

byKey

Use this argument just if list in an associative array (a map). true=sort by key if it is a map, false=sort by value if it is a map