Finds first entry by value.
const map = new Map();map.set('hello', 'a');map.set('there', 'b');const entry = firstEntryByValue(map, 'b');// Entry is: ['there', 'b'] Copy
const map = new Map();map.set('hello', 'a');map.set('there', 'b');const entry = firstEntryByValue(map, 'b');// Entry is: ['there', 'b']
An alternative is firstEntryByValue to search by predicate function.
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.
An alternative is firstEntryByValue to search by predicate function.