Enumerable Max - FireDragon91245/Lua-Linq GitHub Wiki
Returns the biggest item or projected value. You can use a selector and optionally a custom comparison rule.
enumerable<T> :max(): T
enumerable<K, V>:max(): V
enumerable<T> :max(selector: fun(item: T): R): R
enumerable<K, V>:max(selector: fun(key: K, value: V): R): R
enumerable<T> :max(selector: string): any
enumerable<K, V>:max(selector: string): any
enumerable<T> :max(
selector: fun(item: T): R,
is_bigger: fun(a: R, b: R): boolean
): R
enumerable<K, V>:max(
selector: fun(key: K, value: V): R,
is_bigger: fun(a: R, b: R): boolean
): R
enumerable<T> :max(
selector: string,
is_bigger: fun(a: any, b: any): boolean
): any
enumerable<K, V>:max(
selector: string,
is_bigger: fun(a: any, b: any): boolean
): any
enumerable<T> :max(
selector: fun(item: T): R,
is_bigger: string
): R
enumerable<K, V>:max(
selector: fun(key: K, value: V): R,
is_bigger: string
): R
enumerable<T> :max(
selector: string,
is_bigger: string
): any
enumerable<K, V>:max(
selector: string,
is_bigger: string
): any-
selector: stringacts as a key/property selector when it does not contain=>. If it contains=>it is treated as a lambda expression.
local biggest = linq.list(4, 12, 7):max()local winner = linq.list({ score = 4 }, { score = 12 }, { score = 7 })
:max("score")