In lodash I can use the syntax:
find(ARRAY_OF_OBJECTS, OBJECT)
This will return an object from the array if it meets the criteria of the passed object. In this case OBJECT
would be e.g. { active: true, dimension: 'target' }
. The objects in the array would contain e.g. active
, dimension
, status
etc.
How can I do the same in pydash? I know I can do find(ARRAY_OF_OBJECTS, lambda x: x.active == True
, but the thing is, the object I pass is dynamically made. So sometimes it might not have active
(as example)