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