Skip to content

KeySortBy

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

KeySortBy[assoc, f]
    Sorts an association by f applied to each key (stable).

Examples

All examples below are verified against the current Mathilda build.

In[1]:= KeySortBy[<|"bbb" -> 1, "a" -> 2, "cc" -> 3|>, StringLength]
Out[1]= <|"a" -> 2, "cc" -> 3, "bbb" -> 1|>

Implementation notes

Attributes: Protected.

Implementation status

Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

References