listSort (Function)

Signature: listSort(list: List<int> | List<string>) -> List<t0>

Description: Returns a new list sorted in ascending order by the elements' natural order: integers by value, strings by byte content. The sort is stable. Only List<int> and List<string> are supported; any other element type is a compile-time error.

Parameters

  • list (List<int> | List<string>): The list to sort

Returns: List<t0>

Example

let sorted = listSort([3, 1, 2])  // [1, 2, 3]
sorted = listSort [3, 1, 2]  // [1, 2, 3]