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 · 3 comments

Comments

2 participants
@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 from Does _.find work for native Set? to Does _.find work for Set? Jan 14, 2015

@jdalton jdalton added the question label Jan 14, 2015

@jdalton

This comment has been minimized.

Show comment
Hide comment
@jdalton

jdalton Jan 14, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@et

et Jan 14, 2015

Cool, thanks for the quick response.

et commented Jan 14, 2015

Cool, thanks for the quick response.

@jdalton

This comment has been minimized.

Show comment
Hide comment
@jdalton

jdalton Jan 14, 2015

Member

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

Member

jdalton commented Jan 14, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment