Skip to main content

max

For any type T,

max(collection: Bag<T>)  : T?

Returns the greatest item in the collection, or null if it is empty.

  • The greatest item in a collection is selected with the same order used for comparing items with relational expressions such as less-than (<) and greater-than (>).
  • See how comparisons work for more detail on the order of values.
  • Note that this method accepts both Lists and Bags ─since Lists subtype Bags

See also

Types

Functions