array-initial ![NPM version](https://camo.githubusercontent.com/134294fb20cd54a26d04f7d7d852ed2ca496b80bdbb708171967a1bd06fdd805/68747470733a2f2f62616467652e667572792e696f2f6a732f61727261792d696e697469616c2e737667)
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
.