Finds first entry by iterable value. Expects a map with an iterable as values.
const map = new Map();map.set('hello', ['a', 'b', 'c']);map.set('there', ['d', 'e', 'f']);const entry = firstEntryByValue(map, 'e');// Entry is: ['there', ['d', 'e', 'f']] Copy
const map = new Map();map.set('hello', ['a', 'b', 'c']);map.set('there', ['d', 'e', 'f']);const entry = firstEntryByValue(map, 'e');// Entry is: ['there', ['d', 'e', 'f']]
An alternative is firstEntry 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 iterable value. Expects a map with an iterable as values.
An alternative is firstEntry to search by predicate function.