Last active
March 14, 2018 01:25
-
-
Save ezarko/9061597d709102707bfc3a3111a570ea to your computer and use it in GitHub Desktop.
A jQuery reduce function which returns a proper collection object. Note that callback is called with DOM nodes that will need to be $()'d if needed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.reduce = function() { | |
return (arguments.length > 1 || this.length) ? $([].reduce.apply(this.toArray(), arguments)) : this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment