findValue
Returns the first value of a Map whose entry satisfies the predicate, in insertion order.
Available since v3.0.3
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
map | ReadonlyMap<K, V> | The Map to search |
predicate | function | Function invoked with (value, key) |
Returns
Section titled “Returns”V | undefined — The matching value, or undefined if none matches
Examples
Section titled “Examples”Find the first matching value
Section titled “Find the first matching value”Searches in insertion order and returns the value of the first match.
No match
Section titled “No match”Returns undefined when nothing satisfies the predicate.
