Home

function: unzip


unzip(array: Array): Array

This method is like `zip` except that it accepts an array of grouped elements and creates an array regrouping the elements to their pre-zip configuration.

Example(s):

const zipped = zip(['a', 'b'], [1, 2], [true, false])
// => [['a', 1, true], ['b', 2, false]]

unzip(zipped)
// => [['a', 'b'], [1, 2], [true, false]]

Params:

Name Type Attribute Description
array The array of grouped elements to process.

Returns:

Array

  {
    "comment": "/**\r\n * This method is like `zip` except that it accepts an array of grouped\r\n * elements and creates an array regrouping the elements to their pre-zip\r\n * configuration.\r\n *\r\n * @since 1.2.0\r\n * @category Array\r\n * @param {Array} array The array of grouped elements to process.\r\n * @returns {Array} Returns the new array of regrouped elements.\r\n * @see unzipWith, zip, zipObject, zipObjectDeep, zipWith\r\n * @example\r\n *\r\n * const zipped = zip(['a', 'b'], [1, 2], [true, false])\r\n * // => [['a', 1, true], ['b', 2, false]]\r\n *\r\n * unzip(zipped)\r\n * // => [['a', 'b'], [1, 2], [true, false]]\r\n */",
    "meta": {
        "range": [
            933,
            1364
        ],
        "filename": "unzip.js",
        "lineno": 27,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100011356",
            "name": "unzip",
            "type": "FunctionDeclaration",
            "paramnames": [
                "array"
            ]
        },
        "vars": {
            "length": "unzip~length",
            "array": "unzip~array",
            "": null,
            "index": "unzip~index",
            "result": "unzip~result",
            "result[undefined]": "unzip~result[undefined]"
        }
    },
    "description": "This method is like `zip` except that it accepts an array of grouped\relements and creates an array regrouping the elements to their pre-zip\rconfiguration.",
    "since": "1.2.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Array",
            "value": "Array"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "The array of grouped elements to process.",
            "name": "array"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "Returns the new array of regrouped elements."
        }
    ],
    "see": [
        "unzipWith, zip, zipObject, zipObjectDeep, zipWith"
    ],
    "examples": [
        "const zipped = zip(['a', 'b'], [1, 2], [true, false])\r// => [['a', 1, true], ['b', 2, false]]\r\runzip(zipped)\r// => [['a', 'b'], [1, 2], [true, false]]"
    ],
    "name": "unzip",
    "longname": "unzip",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R001031",
    "___s": true,
    "filepath": "unzip.js"
}