back method
Retrieves the last element of the list. Throws a StateError if the list is empty.
Implementation
T back() {
if (_tail == null) {
throw StateError('Cannot get back of an empty SList');
}
return _tail!.value;
}
Retrieves the last element of the list. Throws a StateError if the list is empty.
T back() {
if (_tail == null) {
throw StateError('Cannot get back of an empty SList');
}
return _tail!.value;
}