last source npm

_.last(array)

Gets the last element of array.

Arguments

  1. array (Array)

    The array to query.

Returns (*)

Returns the last element of array.

Example

_.last([1, 2, 3]);
// => 3