From e7ad40d8f4e8a52ee94f370a15512a61c4c18fdc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 2 Oct 2014 09:45:11 -0700 Subject: [PATCH] Make `_.initial` use `_.dropRight` and `_.rest` use `_.drop`. --- lodash.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 920876be3..a061469c4 100644 --- a/lodash.js +++ b/lodash.js @@ -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); } /**