Side navigation
#14389 closed feature (plugin)
Opened September 25, 2013 03:19PM UTC
Closed September 29, 2013 08:38PM UTC
Last modified September 29, 2013 08:38PM UTC
$(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: |
Description
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.
Best as a plugin, we don't need these internally and can just use
.filter()
if we did.