Methods

sortΒΆ

sort(a:Arr, attr:Str, lte:Fun=(a function))

Sort an array based on attribute value
Source: stdlib.ngs:1538

lte

Less-then-or-equal function to use for comparison of the items' attributes

Returns

Arr

Example

[{'x': 1}, {'x': 5}, {'x': 3}].sort('x')  # [{'x': 1}, {'x': 3}, {'x': 5}]