Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10099 closed feature (plugin)

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

Reported by: rr.rosas@… Owned by: rr.rosas@…
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.

Change History (3)

comment:1 Changed 8 years ago by dmethvin

Owner: set to rr.rosas@…
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?

comment:2 in reply to:  1 Changed 8 years ago by rr.rosas@…

Status: pendingnew

Replying to 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.

comment:3 Changed 8 years ago by dmethvin

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.

Note: See TracTickets for help on using tickets.