/object/filter
stdFilters the given object with the given predicate.
Type signature
<T>(f: (value: T, key: string, context: object) => boolean) => (xs: GenericObject<T>) => GenericObject<T>
Examples
filter((x) => x % 2 !== 0)({
a: 1,
b: 2,
c: 3,
});
// ⇒ { a: 1, c: 3 }
Try in REPL
Questions
- How to filter an object?