title: jQuery: use filter(), but work with both results
body: <p>In jQuery, <code>filter()</code> reduces your result to those elements that fulfill a certain condition. </p>
  
  <p>This splits the list in two parts. Working with the "good half" of the elements is easy:</p>
  
  <pre><code>$("some selector").filter(function() {
    // determine result...
    return result;
  }).each( /* do something */ );
  </code></pre>
  
  <p>But how can I work with the "other half" of my elements, too - but without doing the equivalent of <em>this</em>:</p>
  
  <pre><code>$("some selector").filter(function() {
    // determine result...
    return !result;
  }).each( /* do something else */ );
  </code></pre>
  
  <p>Basically, I'd like to feed two separate <code>/* do something */</code> parts to a single filter. One for those that match, and one for the others - without having to filter twice. Am I missing a jQuery function that does this?</p>
  
  <hr>
  
  <p>P.S.: I guess I could do:</p>
  
  <pre><code>$("some selector").each(function() {
    // determine result...
    if (result)
      /* do something */
    else
      /* do something else */
  });
  </code></pre>
  
  <p>But I was hoping for something nicer.</p>