The object to inspect.
The object of property values to match.
Optional
customizer: isMatchWithCustomizerThe function to customize comparisons.
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;
}
}
var object = { 'greeting': 'hello' };
var 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 three arguments: (objValue, srcValue, index|key, object, source).