The value to compare.
The other value to compare.
Optional
customizer: ((v1?, v2?) => boolean)The function to customize comparisons.
Optional
Optional
v1: V1Optional
Optional
v2: V2Optional
Returns true
if the values are equivalent, else false
.
5.10.1
function isGreeting(value) {
return /^h(?:i|ello)$/.test(value)
}
function customizer(objValue, othValue) {
if (isGreeting(objValue) && isGreeting(othValue)) {
return true
}
}
const array = ['hello', 'goodbye']
const other = ['hi', 'goodbye']
isEqualWith(array, other, customizer)
// => true
This method is like
isEqual
except that it acceptscustomizer
which is invoked to compare values. Ifcustomizer
returnsundefined
, comparisons are handled by the method instead. Thecustomizer
is invoked with up to six arguments: (objValue, othValue [, index|key, object, other, stack]).