Is there any elegant way of turning [$(div), $(span), $(li)] into $(div, span, li)?
[$(div), $(span), $(li)]
$(div, span, li)
What I need is a jQuery-wrapped set of elements instead of
If Array.prototype.reduce() is supported in your environment.
Array.prototype.reduce()
var jQueryCollection = [$("a"), $("div")] .reduce(function (masterCollection, collection) { return masterCollection.add(collection); }, $());
jsFiddle.