maxOrZero method

num maxOrZero()
  • return the element with the max value
  • return 0 if isEmpty

Implementation

num maxOrZero() => maxOrNull() ?? 0;