You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fangdawei
ef5e3ecfd0
|
1 year ago | |
---|---|---|
.. | ||
node_modules/is-number | 1 year ago | |
.jshintrc | 1 year ago | |
.npmignore | 1 year ago | |
.travis.yml | 1 year ago | |
LICENSE-MIT | 1 year ago | |
README.md | 1 year ago | |
index.js | 1 year ago | |
package.json | 1 year ago |
README.md
array-initial
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
.