The array to query.
Optional
n: numberThe number of elements to take.
Returns the slice of array
.
5.6.0
takeRight([1, 2, 3])
// => [3]
takeRight([1, 2, 3], 2)
// => [2, 3]
takeRight([1, 2, 3], 5)
// => [1, 2, 3]
takeRight([1, 2, 3], 0)
// => []
Creates a slice of
array
withn
elements taken from the end.