Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@extra-array/zip

Package Overview
Dependencies
Maintainers
1
Versions
344
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@extra-array/zip

Combines values from n arrays, with a function.

Source
npmnpm
Version
2.1.24
Version published
Weekly downloads
57
-86%
Maintainers
1
Weekly downloads
 
Created
Source

Combines values from n arrays, with a function.

This is part of package extra-array.

array.zip(x, [fn], [ths]);
// xs:  n arrays
// fn:  combine function (a, b, c, ...)
// ths: this argument
// --> combined values
const array = require('extra-array');

array.zip([[1, 2, 3], [4, 5, 6]]);
// [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]

array.zip([[1, 2, 3], [4, 5, 6], [0, 0, 0]]);
// [ [ 1, 4, 0 ], [ 2, 5, 0 ], [ 3, 6, 0 ] ]

array.zip([[1, 2, 3], [4, 5, 6]], (a, b) => a + b);
// [ 5, 7, 9 ]

references

Keywords

extra

FAQs

Package last updated on 14 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts