Using Lodash To Find Object In List By Attribute

November 2, 2017
_.find(users, { ‘active’: true });

Use Lodash’s find.

_.find(users, { 'active': true });

For more complex conditions, use the following

_.find(users, function(o) { return o.age < 40; });
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.