just-zip-it
TypeScript icon, indicating that this package has built-in type declarations

3.2.0 • Public • Published

just-zip-it

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-zip-it
yarn add just-zip-it

Returns an array of grouped elements, taking n-th element from every given array

import zip from 'just-zip-it';

zip([1, 2, 3]); // [[1], [2], [3]]
zip([1, 2, 3], ['a', 'b', 'c']); // [[1, 'a'], [2, 'b'], [3, 'c']]
zip([1, 2], ['a', 'b'], [true, false]); //[[1, 'a', true], [2, 'b', false]]

zip(undefined, {}, false, 1, 'foo'); // []
zip([1, 2], ['a', 'b'], undefined, {}, false, 1, 'foo'); // [[1, 'a'], [2, 'b']]

zip([1, 2, 3], ['a', 'b'], [true]); // [[1, 'a', true], [2, 'b', undefined], [3, undefined, undefined]]

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i just-zip-it

      Weekly Downloads

      4,103

      Version

      3.2.0

      License

      MIT

      Unpacked Size

      7.41 kB

      Total Files

      9

      Last publish

      Collaborators

      • angus-c