pop method

T? pop()

removes the last element from the list and returns it

Implementation

T? pop() {
  if (isNotEmpty) {
    return removeLast();
  }
  return null;
}