isLast method

bool isLast(
  1. T element
)

Determine whether the element is the last element of the collection

Implementation

bool isLast(T element) {
  if (isEmpty) return false;
  return last == element;
}