Idiom for finding first non empty jquery set
<p>Javascript uses || operator to short-circuit values, and I would like to have similar behavior for jQuery sets. Is there a better approach from this?</p>

<pre><code>function getFirstNonEmptySet() {

  for (var i = 0; i &lt; arguments.length; i++) {
    if (arguments[i].length) return arguments[i];
  }
  // I know, it's not last argument but null
  return null;
}

// returns second argument
var el = getFirstNonEmptySet( $("#notInDOM"), $(document), $([]) );
</code></pre>
