# getFirst method

T getFirst()

Returns the first element of the iterable.

## Returns

- The first element of the iterable

## Throws

- `LangException` if the iterable is empty

## Example

    final numbers = <int>[1, 2, 3, 5, 6, 7];
    var result = numbers.getFirst(); // 1

## Implementation

    T getFirst() {
      try {
        return first;
      } catch (e) {
        throw LangException("Failed to get first element of iterable");
      }
    }