The object to inspect.
The object of property values to match.
The function to customize comparisons.
Optional
v1: V1Optional
v2: V2Returns true
if object
is a match, else false
.
5.10.0
function isGreeting(value) {
return /^h(?:i|ello)$/.test(value)
}
function customizer(objValue, srcValue) {
if (isGreeting(objValue) && isGreeting(srcValue)) {
return true
}
}
const object = { 'greeting': 'hello' }
const source = { 'greeting': 'hi' }
isMatchWith(object, source, customizer)
// => true
This method is like
isMatch
except that it acceptscustomizer
which is invoked to compare values. Ifcustomizer
returnsundefined
, comparisons are handled by the method instead. Thecustomizer
is invoked with five arguments: (objValue, srcValue, index|key, object, source).