Skip to content

Instantly share code, notes, and snippets.

@lazywithclass
Created December 21, 2011 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lazywithclass/1506629 to your computer and use it in GitHub Desktop.
Save lazywithclass/1506629 to your computer and use it in GitHub Desktop.
jQuery.fn.quickEach = (function() {
var jq = jQuery([1]);
return function(c) {
var i = -1, el, len = this.length;
try {
while (++i < len && (el = jq[0] = this[i]) && c.call(jq, i, el) !== false);
} catch (e) {
delete jq[0];
throw e;
}
delete jq[0];
return this;
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment