mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Make _.initial use _.dropRight and _.rest use _.drop.
This commit is contained in:
@@ -3702,8 +3702,7 @@
|
||||
* // => [1, 2]
|
||||
*/
|
||||
function initial(array) {
|
||||
var length = array ? array.length : 0;
|
||||
return slice(array, 0, (length || 1) - 1);
|
||||
return dropRight(array, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3972,7 +3971,7 @@
|
||||
* // => [2, 3]
|
||||
*/
|
||||
function rest(array) {
|
||||
return slice(array, 1);
|
||||
return drop(array, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user