Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.
zip(['a', 'b'], [1, 2], [true, false])
// => [['a', 1, true], ['b', 2, false]]
Name | Type | Attribute | Description |
---|---|---|---|
arrays | The arrays to process. |
{ "comment": "/**\r\n * Creates an array of grouped elements, the first of which contains the\r\n * first elements of the given arrays, the second of which contains the\r\n * second elements of the given arrays, and so on.\r\n *\r\n * @since 0.1.0\r\n * @category Array\r\n * @param {...Array} [arrays] The arrays to process.\r\n * @returns {Array} Returns the new array of grouped elements.\r\n * @see unzip, unzipWith, zipObject, zipObjectDeep, zipWith\r\n * @example\r\n *\r\n * zip(['a', 'b'], [1, 2], [true, false])\r\n * // => [['a', 1, true], ['b', 2, false]]\r\n */", "meta": { "range": [ 567, 619 ], "filename": "zip.js", "lineno": 18, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100011842", "name": "zip", "type": "FunctionDeclaration", "paramnames": [ "arrays" ] } }, "description": "Creates an array of grouped elements, the first of which contains the\rfirst elements of the given arrays, the second of which contains the\rsecond elements of the given arrays, and so on.", "since": "0.1.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Array", "value": "Array" } ], "params": [ { "type": { "names": [ "Array" ] }, "optional": true, "variable": true, "description": "The arrays to process.", "name": "arrays" } ], "returns": [ { "type": { "names": [ "Array" ] }, "description": "Returns the new array of grouped elements." } ], "see": [ "unzip, unzipWith, zipObject, zipObjectDeep, zipWith" ], "examples": [ "zip(['a', 'b'], [1, 2], [true, false])\r// => [['a', 1, true], ['b', 2, false]]" ], "name": "zip", "longname": "zip", "kind": "function", "scope": "global", "___id": "T000002R001070", "___s": true, "filepath": "zip.js" }