takeRight
_.takeRight(n, array)
# Ⓢ [Ⓣ][1] Ⓝ
Creates a slice of array with n elements taken from the end.
Since
3.0.0
Arguments
n(number): The number of elements to take.array(Array): The array to query.
Returns
(Array): Returns the slice of array.
Example
_.takeRight(1, [1, 2, 3]);
// => [3]
_.takeRight(2, [1, 2, 3]);
// => [2, 3]
_.takeRight(5, [1, 2, 3]);
// => [1, 2, 3]
_.takeRight(0, [1, 2, 3]);
// => []