-
Notifications
You must be signed in to change notification settings - Fork 195
Open
radashi-org/radashi
#27Labels
Description
Hello!
I was wondering if somebody is up to build this one
const root = {a: 2, b: 3, c: {d: 7}, e:8}
pickBy(root, ((x) => x>2) // result: {b:3, e:8}
pickBy(root, ((x) => x.d == 7) // result {c: {d: 7}}
is similar to array.find() but for objects
Smething like this:
const pickBy = (obj, fn) => Object.fromEntries(Object.entries(obj).filter(fn))
PickBy(root, ((k,v])=> v>2)
sodiray and AaronConlon