title: Skip an element with jQuery's $.map
body: <p>I have a jQuery object <code>obj</code> that encapsulates a set of input elements.</p>
  
  <p>I am using this code in order to make an array out of each element's value :</p>
  
  <pre><code>$.map(obj, function(elem, i){
      return $(elem).val();
  });
  </code></pre>
  
  <p>The problem is that sometimes some of the input fields contain invalid values and i would like to skip them in the process of creating the array. Doing a simple <code>return false</code> doesn't seem to skip the element but instead inserts a <code>false</code> in the array.</p>
  
  <p>I would like to know if there is a way to actually do that <strong>without</strong> using <code>.each</code> explicitly.</p>