# element method

E element()

Retrieves, but does not remove, the head of this queue.

Throws InvalidArgumentException if this queue is empty.

Example:

    final queue = Queue<int>();
    queue.offer(42);
    final head = queue.element(); // 42

## Implementation

    E element() {
      if (_elements.isEmpty) {
        throw InvalidArgumentException('Queue is empty');
      }
      return _elements.first;
    }