pop method

T? pop()

Removes and returns the last element of the list.

Returns null if the list is empty.

Implementation

T? pop() {
  if (isEmpty) return null;
  return removeAt(length - 1);
}