Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80742 views
1
var drop = require('./drop');
2
3
/**
4
* Gets all but the first element of `array`.
5
*
6
* @static
7
* @memberOf _
8
* @alias tail
9
* @category Array
10
* @param {Array} array The array to query.
11
* @returns {Array} Returns the slice of `array`.
12
* @example
13
*
14
* _.rest([1, 2, 3]);
15
* // => [2, 3]
16
*/
17
function rest(array) {
18
return drop(array, 1);
19
}
20
21
module.exports = rest;
22
23