Repository navigation
Min
Dennis Corvers edited this page Oct 23, 2026
·
1 revision
Returns the minimum value, or the original item whose selected value is minimum.
minimum = values:min(selector)| Parameter | Type | Description |
|---|---|---|
selector |
function(value, sourceKey) (optional) |
Selects the value used for comparison. |
Without a selector, returns the minimum value. With a selector, returns the original value that has the minimum selected value.
The iterable must contain at least one value. Values or selected values must
support Lua's > comparison.
local lowestSupply = LuaQ.from({
{ name = "Ada", food = 12 },
{ name = "Bryn", food = 3 },
{ name = "Cato", food = 7 },
})
:min(function(player) return player.food end)
-- lowestSupply.name is "Bryn"- Home
- Getting Started
-
Functions
- aggregate
- all
- any
- concat
- contains
- count
- create
- createFrom
- deepCopy
- difference
- elementAt
- elementAtOrDefault
- first
- firstOrDefault
- flatMap
- foreach
- groupBy
- groupByResult
- indexOf
- intersect
- ipairs
- last
- lastOrDefault
- map
- max
- min
- pairs
- sequenceEquals
- single
- singleOrDefault
- sort
- sortBy
- sortByDescending
- sortDescending
- sum
- take
- takeWhile
- thenBy
- thenByDecending
- toLookup
- toMap
- toSet
- toTable
- union
- unique
- where
- zip
- Aliases