Rejects object properties based on a predicate function. Opposite of filterObject - only includes properties where the predicate returns false.
const isEven = (x: number) => x % 2 === 0;rejectObject(isEven)({ a: 1, b: 2, c: 3, d: 4 });// => { a: 1, c: 3 } Copy
const isEven = (x: number) => x % 2 === 0;rejectObject(isEven)({ a: 1, b: 2, c: 3, d: 4 });// => { a: 1, c: 3 }
Object value type
Function that returns true for values to exclude
New object with rejected properties removed
Rejects object properties based on a predicate function. Opposite of filterObject - only includes properties where the predicate returns false.
Example