_max
Produces the most of the received values --
Function
Anything -> _max
(exp) -> The same Type
- Receives
- A List of any sort
- exp (optional)
- An optional expression to apply to each received value
- Produces
- The highest of the received values
In its simple form, with no parameters, _max
takes a List of values, and
produces whatever is most from them:
<7, 28, 3, 5, 108> -> _min
produces 108.
The more interesting and common usage, however, takes one parameter, which is an expression.
This applies the received values (usually Things) to that expression, and produces the one that
had the highest result:
All Games -> _max(Price)
produces the Game with the highest Price.
You can get a similar result by using _sort
and taking the last value of the results, but _max
is much, much faster, and should be used instead when possible.