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