Drop elements from the end of an array with `_.dropRight`
mainCreates a slice of the array with n elements dropped from the end.
Usage:
_.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]Parameters:
array(Array): The array to query.n(number): The number of elements to drop. Defaults to1.
Note: The n argument can be used as an iteratee for methods like _.map.
Sources: lodash.js