Skip to main content

Bug Tracker

Side navigation

#10099 closed feature (plugin)

Opened August 19, 2011 08:36PM UTC

Closed August 29, 2011 09:30PM UTC

Last modified March 09, 2012 09:11PM UTC

Include jQuery.find(array, function(element, index){...})

Reported by: rr.rosas@gmail.com Owned by: rr.rosas@gmail.com
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:
Description

It would work like jQuery.grep but would would return true if the function returns true for some element or false otherwise.

Attachments (0)
Change History (3)

Changed August 27, 2011 08:25PM UTC by dmethvin comment:1

owner: → rr.rosas@gmail.com
status: newpending

There is already a .find() and we wouldn't want to overload the semantics. Can you create an example (using another name) that demonstrates the desired functionality at jsFiddle.net?

Changed August 28, 2011 10:16PM UTC by rr.rosas@gmail.com comment:2

status: pendingnew

Replying to [comment:1 dmethvin]:

There is already a .find() and we wouldn't want to overload the semantics. Can you create an example (using another name) that demonstrates the desired functionality at jsFiddle.net?

Sorry, I don't understand why is that necessary, nor why would $.find conflict with $.fn.find since it doesn't make sense to keep the same semantics for $.find. You could call it anything you like, like findFirst, I really don't care as much as you provide some method that includes this behavior.

Changed August 29, 2011 09:30PM UTC by dmethvin comment:3

resolution: → plugin
status: newclosed

It seems like a really bad idea to have the semantics of $.find conflict significantly with $.fn.find since that would confuse things. Sounds like this would be best done with a plugin and if we thought it was worthwhile we could pull it into core.