Home

function: zipWith


zipWith(arrays: Array, iteratee: function): Array

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

Example(s):

zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c)
// => [111, 222]

Params:

Name Type Attribute Description
arrays The arrays to process.
iteratee The function to combine grouped values.

Returns:

Array

  {
    "comment": "/**\r\n * This method is like `zip` except that it accepts `iteratee` to specify\r\n * how grouped 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} [arrays] The arrays to process.\r\n * @param {Function} iteratee The function to combine\r\n *  grouped values.\r\n * @returns {Array} Returns the new array of grouped elements.\r\n * @see unzip, unzipWith, zip, zipObject, zipObjectDeep, zipWith\r\n * @example\r\n *\r\n * zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c)\r\n * // => [111, 222]\r\n */",
    "meta": {
        "range": [
            648,
            895
        ],
        "filename": "zipWith.js",
        "lineno": 20,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100011910",
            "name": "zipWith",
            "type": "FunctionDeclaration",
            "paramnames": [
                "arrays"
            ]
        },
        "vars": {
            "length": "zipWith~length",
            "iteratee": "zipWith~iteratee"
        }
    },
    "description": "This method is like `zip` except that it accepts `iteratee` to specify\rhow grouped 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"
                ]
            },
            "optional": true,
            "variable": true,
            "description": "The arrays to process.",
            "name": "arrays"
        },
        {
            "type": {
                "names": [
                    "function"
                ]
            },
            "description": "The function to combine\r grouped values.",
            "name": "iteratee"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "Returns the new array of grouped elements."
        }
    ],
    "see": [
        "unzip, unzipWith, zip, zipObject, zipObjectDeep, zipWith"
    ],
    "examples": [
        "zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c)\r// => [111, 222]"
    ],
    "name": "zipWith",
    "longname": "zipWith",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R001076",
    "___s": true,
    "filepath": "zipWith.js"
}