doc/node_modules/array-initial
2021-05-05 15:50:12 +02:00
..
node_modules/is-number Move content to repo root 2021-05-05 15:50:12 +02:00
.jshintrc Move content to repo root 2021-05-05 15:50:12 +02:00
.npmignore Move content to repo root 2021-05-05 15:50:12 +02:00
.travis.yml Move content to repo root 2021-05-05 15:50:12 +02:00
index.js Move content to repo root 2021-05-05 15:50:12 +02:00
LICENSE-MIT Move content to repo root 2021-05-05 15:50:12 +02:00
package.json Move content to repo root 2021-05-05 15:50:12 +02:00
README.md Move content to repo root 2021-05-05 15:50:12 +02:00

array-initial NPM version

Get all but the last element or last n elements of an array.

Install with npm

npm i array-initial --save

Usage

var initial = require('array-initial');

initial(['a', 'b', 'c', 'd', 'e', 'f']);
//=> ['a', 'b', 'c', 'd', 'e']

initial(['a', 'b', 'c', 'd', 'e', 'f'], 1);
//=> ['a', 'b', 'c', 'd', 'e']

initial(['a', 'b', 'c', 'd', 'e', 'f'], 2);
//=> ['a', 'b', 'c', 'd']

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license


This file was generated by verb on December 12, 2014. To update, run npm i -g verb && verb.