#max
Returns the maximum of an array of numbers, optionally after a projection.
#max(array, @x: projection?)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
array |
path | array |
The numbers, or elements to project. |
projection (optional) |
lambda |
Selects the number from each element. |
Returns
Section titled “Returns”number
Examples
Section titled “Examples”Largest property value
Section titled “Largest property value”{ "items": [ { "price": 2 }, { "price": 9 } ]}{ "result": "#max($.items, @x: @x.price)"}{ "result": 9}