Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

just-tail

angus-c85MIT3.2.0TypeScript support: included

return all but the first element of an array

array, tail, no-dependencies, just

readme

just-tail

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-tail
yarn add just-tail

Return all but the first element of an array

import tail from 'just-tail';

tail([1, 2, 3, 4, 5]); // [2, 3, 4, 5]
tail([{a: 1}, {b: 1}, {c: 1}]); // [{b: 1}, {c: 1}]
tail([true, false, [true, false]]); // [false, [true, false]]
tail([]); // []
tail(); // undefined
tail(null); // undefined
tail(undefined); // undefined

changelog

just-tail

3.2.0

Minor Changes

  • Rename node module .js -> .cjs

3.1.1

Patch Changes

  • fix: reorder exports to set default last #488

3.1.0

Minor Changes

  • package.json updates to fix #467 and #483