/object/every
stdTest if every element passes the given predicate.
Type signature
<T>(f: (value: T, key: string, context: object) => boolean) => (xs: GenericObject<T>) => boolean
Examples
every((x) => x >= 0)({
x: 5,
y: 3,
z: 0,
});
// ⇒ true
Try in REPL
every((x) => x > 0)({
x: 5,
y: 3,
z: 0,
});
// ⇒ false
Try in REPL
Questions
- How to check if every entry in an object passes a given predicate?