Creates a slice of array with n elements dropped from the end.
array
n
The array to query.
The number of elements to drop.
Returns the slice of array.
5.16.0
dropRight([1, 2, 3])// => [1, 2]dropRight([1, 2, 3], 2)// => [1]dropRight([1, 2, 3], 5)// => []dropRight([1, 2, 3], 0)// => [1, 2, 3] Copy
dropRight([1, 2, 3])// => [1, 2]dropRight([1, 2, 3], 2)// => [1]dropRight([1, 2, 3], 5)// => []dropRight([1, 2, 3], 0)// => [1, 2, 3]
Creates a slice of
array
withn
elements dropped from the end.