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 = firstEntry(map, (value, key) => { return (value === '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 = firstEntry(map, (value, key) => { return (value === 'e');});// Entry is: ['there', ['d', 'e', 'f']]
An alternative is firstEntryByValue to search by value.
Map to search
Filter function returns true when there is a match of value
Entry, or undefined if filter function never returns true
filter
Finds first entry by iterable value. Expects a map with an iterable as values.
An alternative is firstEntryByValue to search by value.