sort
sort(x)
sort(x, compare)
Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.
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")
|