Reputation: 16102
Here is the find function for Lodash.
var users = [
{ 'user': 'barney', 'age': 36, 'active': true },
{ 'user': 'fred', 'age': 40, 'active': false },
{ 'user': 'pebbles', 'age': 1, 'active': true }
];
_.find(users, function(o) { return o.age < 40; });
// => object for 'barney'
// The `_.matches` iteratee shorthand.
_.find(users, { 'age': 1, 'active': true });
// => object for 'pebbles'
// The `_.matchesProperty` iteratee shorthand.
_.find(users, ['active', false]);
// => object for 'fred'
// The `_.property` iteratee shorthand.
_.find(users, 'active');
// => object for 'barney
Here is the Lodash Github repo.
I'm trying to find the _.find()
function in the repo but I don't see it.
Where is it?
Upvotes: 1
Views: 369
Reputation: 5122
It seems like they have put everything in one file: https://github.com/lodash/lodash/blob/4.17.15/lodash.js
Upvotes: 0