Home

function: zipObject


zipObject(props: Array, values: Array): Object

This method is like `fromPairs` except that it accepts two arrays, one of property identifiers and one of corresponding values.

Example(s):

zipObject(['a', 'b'], [1, 2])
// => { 'a': 1, 'b': 2 }

Params:

Name Type Attribute Description
props The property identifiers.
values The property values.

Returns:

Object

  {
    "comment": "/**\r\n * This method is like `fromPairs` except that it accepts two arrays,\r\n * one of property identifiers and one of corresponding values.\r\n *\r\n * @since 0.4.0\r\n * @category Array\r\n * @param {Array} [props=[]] The property identifiers.\r\n * @param {Array} [values=[]] The property values.\r\n * @returns {Object} Returns the new object.\r\n * @see unzip, unzipWith, zip, zipObjectDeep, zipWith\r\n * @example\r\n *\r\n * zipObject(['a', 'b'], [1, 2])\r\n * // => { 'a': 1, 'b': 2 }\r\n */",
    "meta": {
        "range": [
            590,
            692
        ],
        "filename": "zipObject.js",
        "lineno": 19,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100011862",
            "name": "zipObject",
            "type": "FunctionDeclaration",
            "paramnames": [
                "props",
                "values"
            ]
        }
    },
    "description": "This method is like `fromPairs` except that it accepts two arrays,\rone of property identifiers and one of corresponding values.",
    "since": "0.4.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Array",
            "value": "Array"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "optional": true,
            "defaultvalue": "[]",
            "description": "The property identifiers.",
            "name": "props"
        },
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "optional": true,
            "defaultvalue": "[]",
            "description": "The property values.",
            "name": "values"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "Object"
                ]
            },
            "description": "Returns the new object."
        }
    ],
    "see": [
        "unzip, unzipWith, zip, zipObjectDeep, zipWith"
    ],
    "examples": [
        "zipObject(['a', 'b'], [1, 2])\r// => { 'a': 1, 'b': 2 }"
    ],
    "name": "zipObject",
    "longname": "zipObject",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R001072",
    "___s": true,
    "filepath": "zipObject.js"
}