removeFirstOrNull method
T?
removeFirstOrNull()
Removes the first element from this mutable list.
Returns that removed element, or null
if this list is empty.
Implementation
T? removeFirstOrNull() {
if (isEmpty()) return null;
return removeAt(0);
}