sort
sort(x)
sort(x, compare)
Try it yourself:
$1 |
sort([5, 10, 1])
|
|
$2 |
sort(["C", "B", "A", "D"], "natural")
|
|
$3 |
sortByLength(a, b) = size(a)[1] - size(b)[1]
|
|
$4 |
sort(["Langdon", "Tom", "Sara"], sortByLength)
|
|
$5 |
sort(["10", "1", "2"], "natural")
|