59b7a7d96dfbda88c1e0781a21dd17debc88814b
[yaffs-website] / node_modules / grunt-legacy-log / node_modules / lodash / array / initial.js
1 var dropRight = require('./dropRight');
2
3 /**
4  * Gets all but the last element of `array`.
5  *
6  * @static
7  * @memberOf _
8  * @category Array
9  * @param {Array} array The array to query.
10  * @returns {Array} Returns the slice of `array`.
11  * @example
12  *
13  * _.initial([1, 2, 3]);
14  * // => [1, 2]
15  */
16 function initial(array) {
17   return dropRight(array, 1);
18 }
19
20 module.exports = initial;