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'] Copy
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.
isEqualValueDefault
Map to search
Value to seek
Filter function which checks equality. Uses JS comparer by default.
Entry, or undefined if value not found.
value
Finds first entry by value.
Uses JS's === comparison by default. Consider using
isEqualValueDefault
to match by value. An alternative is findEntryByValue to search by predicate function.