This method is like `clone` except that it recursively clones `value`.
const objects = [{ 'a': 1 }, { 'b': 2 }]
const deep = cloneDeep(objects)
console.log(deep[0] === objects[0])
// => false
Name | Type | Attribute | Description |
---|---|---|---|
value | The value to recursively clone. |
*
{ "comment": "/**\r\n * This method is like `clone` except that it recursively clones `value`.\r\n *\r\n * @since 1.0.0\r\n * @category Lang\r\n * @param {*} value The value to recursively clone.\r\n * @returns {*} Returns the deep cloned value.\r\n * @see clone\r\n * @example\r\n *\r\n * const objects = [{ 'a': 1 }, { 'b': 2 }]\r\n *\r\n * const deep = cloneDeep(objects)\r\n * console.log(deep[0] === objects[0])\r\n * // => false\r\n */", "meta": { "range": [ 556, 651 ], "filename": "cloneDeep.js", "lineno": 23, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100000601", "name": "cloneDeep", "type": "FunctionDeclaration", "paramnames": [ "value" ] } }, "description": "This method is like `clone` except that it recursively clones `value`.", "since": "1.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Lang", "value": "Lang" } ], "params": [ { "type": { "names": [ "*" ] }, "description": "The value to recursively clone.", "name": "value" } ], "returns": [ { "type": { "names": [ "*" ] }, "description": "Returns the deep cloned value." } ], "see": [ "clone" ], "examples": [ "const objects = [{ 'a': 1 }, { 'b': 2 }]\r\rconst deep = cloneDeep(objects)\rconsole.log(deep[0] === objects[0])\r// => false" ], "name": "cloneDeep", "longname": "cloneDeep", "kind": "function", "scope": "global", "___id": "T000002R000064", "___s": true, "filepath": "cloneDeep.js" }