Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does _.find work for Set? #858

Closed
et opened this issue Jan 14, 2015 · 4 comments
Closed

Does _.find work for Set? #858

et opened this issue Jan 14, 2015 · 4 comments
Labels

Comments

@et
Copy link

@et et commented Jan 14, 2015

I may not be using _.find properly, but does it work similar as it does for an Array?

Consider this test case

var s = new Set();
s.add({"prop": "value"});
_.find(s, { "prop": "value" }) // undefined

var arr = [];
arr.push({"prop": "value"});
_.find(arr, { "prop": "value"}); // Object {prop: "value"} 
@et et changed the title Does _.find work for native Set? Does _.find work for Set? Jan 14, 2015
@jdalton jdalton added the question label Jan 14, 2015
@jdalton
Copy link
Member

@jdalton jdalton commented Jan 14, 2015

Hi @et! _.find works on collections which are things like arrays, strings, objects, & array-like objects.

We currently don't support and have no plans to support sets or maps as collections but I'll keep an eye on the popularity of the request.

Related #737.

@jdalton jdalton closed this Jan 14, 2015
@et
Copy link
Author

@et et commented Jan 14, 2015

Cool, thanks for the quick response.

@jdalton
Copy link
Member

@jdalton jdalton commented Jan 14, 2015

We do however use Set and WeakMap internally for optimizations in lodash v3 😸

@lock
Copy link

@lock lock bot commented Jan 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.