Urara-Blog/node_modules/.pnpm-store/v3/files/c7/8c514e87c7e2d81fd9b158d93056a405bcc55ccee6db308df1f9a2273186e1ae53f13d1f87cee794be16717282146aa589487e15f054123142618a0985c3d9
2022-08-14 01:14:53 +08:00

22 lines
461 B
Text

var baseSlice = require('./_baseSlice');
/**
* Gets all but the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.initial([1, 2, 3]);
* // => [1, 2]
*/
function initial(array) {
var length = array == null ? 0 : array.length;
return length ? baseSlice(array, 0, -1) : [];
}
module.exports = initial;