firstOrNull property

T? firstOrNull

first element or null if empty.

Implementation

T? get firstOrNull => length == 0 ? null : this[0];