Function hasKeyValue

Returns true if map contains value under key, using comparer function. Use hasAnyValue if you don't care what key value might be under.

Having a comparer function is useful to check by value rather than object reference.

hasKeyValue(map,`hello`, `samantha`, (a, b) => a === b);
  • Type Parameters

    • K
    • V

    Parameters

    • map: ReadonlyMap<K, V>

      Map to search

    • key: K

      Key to search

    • value: V

      Value to search

    • comparer: IsEqual<V>

      Function to determine match

    Returns boolean

    True if key is found