js-interleave
v1.0.1
Published
Get an array with first item in each iterable collection, then the second etc.
Downloads
2
Readme
js-interleave
Get an array with first item in each iterable collection, then the second etc.
Installation
$ npm i js-interleave
Usage
import interleave from 'js-interleave';
interleave([1, 2], [3, 4]); // [1, 3, 2, 4]
interleave(new Set([1, 2]), new Set([3, 4])); // [1, 3, 2, 4]
interleave(Immutable.List([1, 2]), Immutable.List([3, 4])); // [1, 3, 2, 4]