Edit This Page

first()

Get the first element of the Enumerable.

Returns

(any): first element of the Enumerable.

Example

Enumerable
        .from([4, 7, 2])
        .first();
// 4