Last active
April 12, 2019 23:44
-
-
Save rcdexta/d367b6f8f342aa2c2ae913a3de94d99c to your computer and use it in GitHub Desktop.
_.find vs native find
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const users = [ | |
{ 'user': 'joey', 'age': 32 }, | |
{ 'user': 'ross', 'age': 41 }, | |
{ 'user': 'chandler', 'age': 39 } | |
] | |
// Native | |
users.find(function (o) { return o.age < 40; }) | |
//lodash | |
_.find(users, function (o) { return o.age < 40; }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment