Skip to main content
Returns the elements of the input array in ascending order. If the argument <function> is provided, the sort order is determined by the result of applying <function> on each element of the array.

Syntax

ARRAY_SORT supports two signatures:

Parameters

Return Type

ARRAY of the same type as the input array

Examples

Rows: 1Execution time: 5.52ms

In this example, the modulus operator is used to calculate the remainder on any odd numbers. Therefore ARRAY_SORT puts the higher (odd) numbers last in the results.

Rows: 1Execution time: 5.54ms

In this example, two array arguments are passed in. Therefore, a lambda with two parameters must be used as the first argument.

Rows: 1Execution time: 5.28ms