_.cloneDeepWith(value, [customizer])
This method is like _.cloneWith
except that it recursively clones value
.
Since
4.0.0
Arguments
value
(*): The value to recursively clone.[customizer]
(Function): The function to customize cloning.
Returns
(*): Returns the deep cloned value.
Example
function customizer(value) {if (_.isElement(value)) {return value.cloneNode(true);}}var el = _.cloneDeepWith(document.body, customizer);console.log(el === document.body);// => falseconsole.log(el.nodeName);// => 'BODY'console.log(el.childNodes.length);// => 20
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .