Wilang Documentation1.0.0+4

sort#

Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.

Available in: math cells, REPL.

Syntax#

sort(x)
sort(x, compare)

Arguments and behavior#

For matrices, dimensions must match the operation. Singular matrices or incompatible shapes can fail. Cell indexing starts at 1. The example returns matrix.

Example#

Edit the inputs, then use Run or Reset. Changes stay in this example.

Example
sort([5, 10, 1])

Expected result: matrix.

See also#

map · filter · forEach

All functions · Math guides