Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jonschlinkert/array-initial

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 3

AltStyle によって変換されたページ (->オリジナル) /