shift<T> method
Remove and return the first element from a list.
Implementation
T shift<T>(List<T> l) {
if (l.isNotEmpty) {
final T first = l.first;
l.removeAt(0);
return first;
}
return null as T;
}
Remove and return the first element from a list.
T shift<T>(List<T> l) {
if (l.isNotEmpty) {
final T first = l.first;
l.removeAt(0);
return first;
}
return null as T;
}