Edit This Page

last()

Get the last element of the Enumerable.

Returns

(any): last element of the Enumerable.

Example

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