removeFirst method

T removeFirst()

Removes the first element from this mutable list.

Returns that removed element, or throws NoSuchElementException if this list is empty.

Implementation

T removeFirst() {
  if (isEmpty()) {
    throw const NoSuchElementException('List is empty.');
  }
  return removeAt(0);
}