mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Bump to v4.14.2.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import dropRight from './dropRight.js';
|
||||
import baseSlice from './_baseSlice.js';
|
||||
|
||||
/**
|
||||
* Gets all but the last element of `array`.
|
||||
@@ -15,7 +15,8 @@ import dropRight from './dropRight.js';
|
||||
* // => [1, 2]
|
||||
*/
|
||||
function initial(array) {
|
||||
return dropRight(array, 1);
|
||||
var length = array ? array.length : 0;
|
||||
return length ? baseSlice(array, 0, -1) : [];
|
||||
}
|
||||
|
||||
export default initial;
|
||||
|
||||
Reference in New Issue
Block a user