-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Open
Labels
Description
I'd like to use a function but it seems it's missing. I didn't find any issue for this, and I didn't find it in https://github.com/documentcloud/underscore-contrib (but I'm not sure how to search efficiently here)
function description:
findKeys
_.findKeys(object, predicate, [context])
Returns an array of keys where the predicate truth test passes (or empty array).
_.findKeys({ a: 1, b: 2, c: 3, d: 2}, function (val, key) { return val === 2; })
=> ["b", "d"]
_.findKeys({ a: 1, b: 2, c: 3, d: 2}, function (val, key) { return val === 4; })
=> []
Am I the only one who would need this ? If not, i can do a PR