Is there any elegant way of turning [$(div), $(span), $(li)]
into $(div, span, li)
?
What I need is a jQuery-wrapped set of elements instead of
A bit more concise than the accepted answer, one can use the $.fn.toArray
as the argument passed to $.fn.map
:
var list = [$(''), $(''), $('')];
$(list).map($.fn.toArray);
Or perhaps (this is really inferior, but only has one function call in your code):
$.fn.map.call(list, $.fn.toArray);