Home

function: unzipWith


unzipWith(array: Array, iteratee: function): Array

This method is like `unzip` except that it accepts `iteratee` to specify how regrouped values should be combined. The iteratee is invoked with the elements of each group: (...group).

Example(s):

const zipped = zip([1, 2], [10, 20], [100, 200])
// => [[1, 10, 100], [2, 20, 200]]

unzipWith(zipped, add)
// => [3, 30, 300]

Params:

Name Type Attribute Description
array The array of grouped elements to process.
iteratee The function to combine regrouped values.

Returns:

Array

  {
    "comment": "/**\r\n * This method is like `unzip` except that it accepts `iteratee` to specify\r\n * how regrouped values should be combined. The iteratee is invoked with the\r\n * elements of each group: (...group).\r\n *\r\n * @since 3.8.0\r\n * @category Array\r\n * @param {Array} array The array of grouped elements to process.\r\n * @param {Function} iteratee The function to combine\r\n *  regrouped values.\r\n * @returns {Array} Returns the new array of regrouped elements.\r\n * @example\r\n *\r\n * const zipped = zip([1, 2], [10, 20], [100, 200])\r\n * // => [[1, 10, 100], [2, 20, 200]]\r\n *\r\n * unzipWith(zipped, add)\r\n * // => [3, 30, 300]\r\n */",
    "meta": {
        "range": [
            702,
            908
        ],
        "filename": "unzipWith.js",
        "lineno": 23,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100011442",
            "name": "unzipWith",
            "type": "FunctionDeclaration",
            "paramnames": [
                "array",
                "iteratee"
            ]
        },
        "vars": {
            "result": "unzipWith~result",
            "": null
        }
    },
    "description": "This method is like `unzip` except that it accepts `iteratee` to specify\rhow regrouped values should be combined. The iteratee is invoked with the\relements of each group: (...group).",
    "since": "3.8.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Array",
            "value": "Array"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "The array of grouped elements to process.",
            "name": "array"
        },
        {
            "type": {
                "names": [
                    "function"
                ]
            },
            "description": "The function to combine\r regrouped values.",
            "name": "iteratee"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "Returns the new array of regrouped elements."
        }
    ],
    "examples": [
        "const zipped = zip([1, 2], [10, 20], [100, 200])\r// => [[1, 10, 100], [2, 20, 200]]\r\runzipWith(zipped, add)\r// => [3, 30, 300]"
    ],
    "name": "unzipWith",
    "longname": "unzipWith",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R001039",
    "___s": true,
    "filepath": "unzipWith.js"
}