arr

arrzip

Makes one array by aggregating elements from other arrays.

Showing:

Popularity

Downloads/wk

4

GitHub Stars

3

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

arrzip

npm version Build Status NPM downloads

Makes an array that aggregates elements from each of the arrays.

Installation

npm install arrzip

Usage

var zip = require('../arrzip');

var a = [1,2,3,4];
var b = [6,7,8,9,0];
var c = [10,11,12,13,14,15];
var longest = zip(a,b,c,true);
var shortest = zip(a,b,c);

console.log(longest);
//=>[ [ 1, 6, 10 ], [ 2, 7, 11 ], [ 3, 8, 12 ], [ 4, 9, 13 ], [ 0, 14 ], [ 15 ] ]

console.log(shortest);
//=>[ [ 1, 6, 10 ], [ 2, 7, 11 ], [ 3, 8, 12 ], [ 4, 9, 13 ] ]

API

zip(*arguments[, longest])

*arguments

Type: Array
Condition: N number of arrays

longest

Type: Boolean
true: zip based on longest Array
false: zip based on shortest Array
default: false

Merge N number of arrays by shortest or longest array

##License

MIT © Alex Brelsford

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100