Returns true
if object
is a match, else false
.
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).