Grouping.first Method

Returns the first element of the sequence. If "predicate" is provided, returns the first element that satisfies that condition.
 

Parameters

predicate

Type: Function
A function to test each element for a condition, returning true or false.
Optional: True

Return Value


The first element of the sequence that satisfies the specified condition.