every
Checks if every entry of a Map satisfies the predicate. Short-circuits on the first mismatch.
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 check |
predicate | function | Function invoked with (value, key) |
Returns
Section titled “Returns”boolean — true if all entries match (vacuously true for an empty map), false otherwise
Examples
Section titled “Examples”Check that all values are positive
Section titled “Check that all values are positive”Returns false as soon as one entry fails the predicate.
Empty map
Section titled “Empty map”Vacuously true for an empty map.
