Returns true if any key contains value, based on the provided comparer function. Use hasKeyValue if you only want to find a value under a certain key.
value
comparer
Having a comparer function is useful to check by value rather than object reference.
Map to search
Value to find
Function that determines matching. Should return true if a and b are considered equal.
a
b
True if value is found
hasAnyValue(map, {name:`samantha`}, (a, b) => a.name === b.name); Copy
hasAnyValue(map, {name:`samantha`}, (a, b) => a.name === b.name);
Works by comparing value against all values contained in map for equality using the provided comparer.
map
Returns true if any key contains
value
, based on the providedcomparer
function. Use hasKeyValue if you only want to find a value under a certain key.Having a comparer function is useful to check by value rather than object reference.