This method is like clone except that it accepts customizer which
is invoked to produce the cloned value. If customizer returns undefined,
cloning is handled by the method instead. The customizer is invoked with
one argument (value).
Parameters
value: any
The value to clone.
Optionalcustomizer: (...any:any[])=>any
The function to customize cloning.
Returns any
Returns the cloned value.
Since
5.3.0
See
cloneDeepWith
Example
functioncustomizer(value) { if (isElement(value)) { returnvalue.cloneNode(false) } }
This method is like
clone
except that it acceptscustomizer
which is invoked to produce the cloned value. Ifcustomizer
returnsundefined
, cloning is handled by the method instead. Thecustomizer
is invoked with one argument (value).