pickByPredicate({ a: 1, b: 0, c: 2 }, v => v > 0)
// β { a: 1, c: 2 }pickByPredicate returns a new object with only the entries whose values satisfy the predicate.
Challenge: Implement pickByPredicate<T extends object>(obj: T, pred: (v: T[keyof T]) => boolean): Partial<T> keeping only the entries where the value passes the predicate.
pickByPredicate({ a: 1, b: 2, c: 3 }, v => v > 1) // β { b: 2, c: 3 }