lastOrNull method

T? lastOrNull()
  • return the last element
  • return null if isEmpty

Implementation

T? lastOrNull() => isEmpty ? null : last;