Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#14389 closed feature (plugin)

$(selector).every(fn) and $(selector).any(fn) methods would be a nice addition

Reported by: vigneshwaran Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


It will be very convenient if jQuery has .every() and .any() methods.

I gave it a try http://jsfiddle.net/vigneshwaranr/dYatz/

var result = $('p').every(function() { return <somecondition> });

is a lot simpler than doing the same with .each() method which requires a for loop every time.

Change History (2)

comment:1 Changed 9 years ago by dmethvin

Resolution: plugin
Status: newclosed

Best as a plugin, we don't need these internally and can just use .filter() if we did.

comment:2 Changed 9 years ago by dmethvin

#14388 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.