The Lodash library has a findKey() function that returns the first property name for which the given value is found. The where and pluck style callbacks are supported, as with most lodash functions of this kind. As is passing in our own callback to determine whether the value has been found or not. This is where we can handle some rather subtle use cases. For instance, what happens when one of the properties you're checking against is an array of objects. Meanwhile, one of those objects has the value you're looking for.
Showing posts with label findkey. Show all posts
Showing posts with label findkey. Show all posts
Monday, March 31, 2014
Subscribe to:
Posts
(
Atom
)