Files
lodash/tail.js
John-David Dalton 6cb3460fce Remove semicolons.
2017-02-05 22:22:04 -08:00

21 lines
433 B
JavaScript

import baseSlice from './.internal/baseSlice.js'
/**
* Gets all but the first element of `array`.
*
* @since 4.0.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* tail([1, 2, 3])
* // => [2, 3]
*/
function tail(array) {
const length = array == null ? 0 : array.length
return length ? baseSlice(array, 1, length) : []
}
export default tail