sort

FEEL built-in function · List functions

sort(list, precedes?)

Returns the list sorted by the precedes function; without one, comparable elements sort in their natural ascending order.

Parameters

ParameterTypeDescription
listlistthe list to sort
precedesfunctionordering function taking two elements and returning true if the first sorts before the second (optional for comparable elements)

Examples

sort([3, 1, 2])
[1, 2, 3] Try it →
sort(["b", "a", "c"], function(x, y) x < y)
[a, b, c] Try it →

Related functions

reverse

Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).