initial source npm

_.initial(array)

Gets all but the last element of array.

Arguments

  1. array (Array)

    The array to query.

Returns (Array)

Returns the slice of array.

Example

_.initial([1, 2, 3]);
// => [1, 2]