firstOrNull

inline fun <Type> GdxArray<Type>.firstOrNull(): Type?

Return

the first element or null if the array is empty.


inline fun <Type> GdxArray<Type>.firstOrNull(predicate: (Type) -> Boolean): Type?

Return

the first element matching the predicate or null if there is none. Does not use GdxArray.iterator, so it does not allocate and can be safely nested.