List Sort
The list::sort
function sorts the elements of a list in ascending order.
Syntax
list::sort(<list>)
Parameters
list
: The input list to be sorted. Elements must be of the same type and comparable (e.g., numbers or strings).
Returns
- List: A new list with elements sorted in ascending order.
Example
list::sort([4, 2, 5, 1, 3])
This function is useful for organizing data in a predictable sequence for processing or display.