lastOrOption property

Option<T> get lastOrOption

Returns the last element of the slice, or None if it is empty.

Implementation

Option<T> get lastOrOption {
  if (isEmpty) {
    return None;
  }
  return Some(_list[_end - 1]);
}