This method is like merge except that it accepts customizer which
is invoked to produce the merged values of the destination and source
properties. If customizer returns undefined, merging is handled by the
method instead. The customizer is invoked with six arguments:
(objValue, srcValue, key, object, source, stack).
Note: This method mutates object.
Parameters
object: any
The destination object.
...sourcesOrCustomizer: any[]
The source objects. The function to customize assigned values.
Returns any
Returns object.
Since
5.12.0
Example
functioncustomizer(objValue, srcValue) { if (Array.isArray(objValue)) { returnobjValue.concat(srcValue) } }
This method is like
merge
except that it acceptscustomizer
which is invoked to produce the merged values of the destination and source properties. Ifcustomizer
returnsundefined
, merging is handled by the method instead. Thecustomizer
is invoked with six arguments: (objValue, srcValue, key, object, source, stack).Note: This method mutates
object
.