# getLast method

T getLast()

Returns the last element of the iterable.

## Returns

- The last element of the iterable

## Throws

- `LangException` if the iterable is empty

## Example

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

## Implementation

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