Sorts the Collection according to the assigned expression.
sortedBy(Block expression) | |||
---|---|---|---|
Argument | Block | expression | |
Return value | Collection | Sorted collection. The collection has the same type, as the collection, that sortedBy is sent to. |
Formula | Result |
---|---|
=List{'abc','c','bf'}.sortedBy(x|x.size) | [c, bf, abc] |
=List{'abc','c','bf'}.sortedBy(x|x.$Name) | [abc,bf,c] |