Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#10099 closed feature (plugin)

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

Reported by: [email protected] Owned by: [email protected]
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 12 years ago by dmethvin

Owner: set to [email protected]
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 12 years ago by [email protected]

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 12 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.