kotlin-stdlib / kotlin.collections / removeLastOrNull removeLastOrNull Common JVM JS Native 1.4 fun < T > MutableList < T > . removeLastOrNull ( ) : T ? (source) Removes the last element from this mutable list and returns that removed element, or returns null if this list is empty.