MCPcopy
hub / github.com/lodash/lodash / initial

Function initial

lodash.js:7571–7574  ·  view source on GitHub ↗

* 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

(array)

Source from the content-addressed store, hash-verified

7569 * // => [1, 2]
7570 */
7571 function initial(array) {
7572 var length = array == null ? 0 : array.length;
7573 return length ? baseSlice(array, 0, -1) : [];
7574 }
7575
7576 /**
7577 * Creates an array of unique values that are included in all given arrays

Callers

nothing calls this directly

Calls 1

baseSliceFunction · 0.85

Tested by

no test coverage detected