ixfx
    Preparing search index...

    Function findEntryByValue

    • Finds first entry by value.

      const map = new Map();
      map.set('hello', 'a');
      map.set('there', 'b');

      const entry = findEntryByValue(map, 'b');
      // Entry is: ['there', 'b']

      Uses JS's === comparison by default. Consider using isEqualValueDefault to match by value. An alternative is findEntryByValue to search by predicate function.

      Type Parameters

      • K
      • V

      Parameters

      • map: IWithEntries<K, V>

        Map to search

      • value: V

        Value to seek

      • isEqual: IsEqual<V> = isEqualDefault

        Filter function which checks equality. Uses JS comparer by default.

      Returns undefined | readonly [K, V]

      Entry, or undefined if value not found.