max method

num max()
  • return the element with the max value ! throws StateError if isEmpty

Implementation

num max() => maxOrNull() ?? (throw StateError('list is empty'));