Home

function: flattenDeep


flattenDeep(array: Array): Array

Recursively flattens `array`.

Example(s):

flattenDeep([1, [2, [3, [4]], 5]])
// => [1, 2, 3, 4, 5]

Params:

Name Type Attribute Description
array The array to flatten.

Returns:

Array

  {
    "comment": "/**\r\n * Recursively flattens `array`.\r\n *\r\n * @since 3.0.0\r\n * @category Array\r\n * @param {Array} array The array to flatten.\r\n * @returns {Array} Returns the new flattened array.\r\n * @see flatMap, flatMapDeep, flatMapDepth, flatten, flattenDepth\r\n * @example\r\n *\r\n * flattenDeep([1, [2, [3, [4]], 5]])\r\n * // => [1, 2, 3, 4, 5]\r\n */",
    "meta": {
        "range": [
            476,
            612
        ],
        "filename": "flattenDeep.js",
        "lineno": 19,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100002673",
            "name": "flattenDeep",
            "type": "FunctionDeclaration",
            "paramnames": [
                "array"
            ]
        },
        "vars": {
            "length": "flattenDeep~length"
        }
    },
    "description": "Recursively flattens `array`.",
    "since": "3.0.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Array",
            "value": "Array"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "The array to flatten.",
            "name": "array"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "Returns the new flattened array."
        }
    ],
    "see": [
        "flatMap, flatMapDeep, flatMapDepth, flatten, flattenDepth"
    ],
    "examples": [
        "flattenDeep([1, [2, [3, [4]], 5]])\r// => [1, 2, 3, 4, 5]"
    ],
    "name": "flattenDeep",
    "longname": "flattenDeep",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R000289",
    "___s": true,
    "filepath": "flattenDeep.js"
}